aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-02-26testing: serial: pass baudrate list from cliHEADmasterFarouk Bouabid
Some serial ports do not support specific baudrates or we are maybe not interested in testing certain baudrate when running the fuzzing test. Allow the user to pass multiple baudrates as a cli argument and have the script randomly pick one of the baudrates while fuzz testing. Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
2024-02-08mule-attiny.sh: support Tiger v1.1Quentin Schulz
Tiger v1.1 has the UPDI lanes cut by default unless ATtiny_GATE_CONTROL_d (GPIO0_C4) is pulled high. Let's toggle that GPIO before flashing so that the UPDI can go through to the ATtiny. Since that GPIO was used for UART0 in Tiger v1.0, it is not supported anymore (but those were engineering samples anyway). Relates-to: TIGR-192 Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2024-01-29testing: serial: test-serial: use ioctls to enable/disable rs485Farouk Bouabid
Using "serial.rs485" api, the "_set_rs485_mode" callback of serialposix is not triggered when "rs485_mode" property is updated since its setter is overridden, making the "serial.rs485" a self-standing emulation for rs485. Since we already have a kernel emulation for half duplex rs485, we should make use of it by calling the respective ioctls to enable/disable it when required. Explicitly call "_set_rs485_mode" by passing "serial.rs485.RS485Settings" (enable) or None (disable) instead of setting this property. Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
2024-01-23testing: serial: test-serial: fix test size in unidirectional modeFarouk Bouabid
Similar to commit 040de5bcc ("testing: serial: test-serial: fix test size "), also unidirectional mode must use the local "size variable" Fixes: 040de5bcc ("testing: serial: test-serial: fix test size ") Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
2024-01-23testing: serial: test-serial: fix test sizeFarouk Bouabid
The test size can be randomized if the fuzz option is used and min/max size are passed as cli arguments. The value holding the final test size is a local variable ("size"). Pass it as argument to the transfer function instead of the cli argument. Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
2023-12-18apt install python-usb changed to python3-usb in READMEManfred Mueller
2023-11-30mule-attiny: bitbang_updi_reset: provide clear instructions for DebianQuentin Schulz
Provide clear instructions for Debian users to lower the barrier of entry. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-11-30mule-attiny: i2c-flash: provide clear instructions for DebianQuentin Schulz
Provide clear instructions for Debian users to lower the barrier of entry. Relates-to: RNG-175 Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-11-30mule-attiny: i2c_flash: migrate to C-bindings-based official gpiod Python ↵Quentin Schulz
package The unofficial pure-Python gpiod package was replaced by C-bindings-based official gpiod Python package on Pypi and the former is deprecated. c.f. https://pypi.org/project/gpiod/ """ Versions 1.5.4 and prior are the deprecated, unofficial, pure-Python bindings. """ While this isn't necessarily something we should worry about in the short term, it turns out that distros actually do not package the pure-Python, so this makes it less easy to install the dependencies for i2c_flash.py. We could support v1.6.3 gpiod to be able to install it from Debian package feed, however v1.6.x is in maintenance-only state and v2.x is actively being developed with additional features, so let's just play it safe and migrate to v2.x version. We bump the requirements to the latest available version so that it uses the C-bindings-based official implementation hosted on Pypi. See https://github.com/hhk7734/python3-gpiod/issues/39 for the discussions and history behind gpiod on Pypi. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-11-29mule-attiny: Add script to flash mule-attiny on tiger/jaguarIskander Amara
Script for flashing mule-attiny FW on Jaguar and Tiger with a minimal intervention from end-user. Usage: ./mule-attiny.sh --flash [<firmware] --flash <firmware> - flash the given firmware Relates-to : JAG-103 Signed-off-by: Iskander Amara <iskander.amara@theobroma-systems.com>
2023-11-28mule-attiny: bitbang_updi_reset: Remove MakefileKlaus Goger
Everything in place to use meson exclusively and we can finally remove the Makefile. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2023-11-28mule-attiny: bitbang_updi_reset: update README for mesonKlaus Goger
As we now have a meson build file we need to describe it in the README. Because we now have an install target remove the ./ prefix of the usage examples. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2023-11-28mule-attiny: bitbang_updi_reset: add meson fileKlaus Goger
Instead of doing Makefile magic we could use a modern build system like meson. This commits tries to replicate the features of the current Makefile. To build: # create build directory meson build meson compile -C build As an alternative you can also change to the build dir and do a meson compile. Test reset Makefile target was implemented as a unittest meson test -C build As meson really does not want you to use environment variables in its definitions you can only pass a complete environment to an external command. To not add a wrapper script I decided to add build options. Currently the GPIOs are set to match Ringneck. To change the settings (for example Jaguar) use: meson configure build -Drst_gpio_idx=13 -Drst_gpiochip_idx=2 Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2023-11-24.gitlab-ci.yml: run shellcheck on all shell scriptsQuentin Schulz
Let's run shellcheck on all our current and future shell scripts so we can catch mistakes before they reach users. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-11-08add new test for serialQuentin Schulz
Testing serial is quite useful especially since we've had some issues with RS232 and RS485 already, so let's add a Python script that is nicely configurable to test many different scenarios. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-11-08mule-attiny: bitbang_updi_reset: rebuild when sources changeFarouk Bouabid
Executing make will not rebuild the target in case a file has changed unless the target depend on these files. Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
2023-10-25mule: mule.sh: add support for Puma Haikou Video Demo adapter DTSQuentin Schulz
Puma Haikou Video Demo adapter DTS actually has a model name which starts with "Theobroma Systems RK3399-Q7 SoM" but isn't exactly this string, therefore the match needs to be extended to include Puma Haikou Video Demo adapter DTS. c.f. https://git.theobroma-systems.com/puma-linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou-video-demo.dts#n13 Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-10-18mule-attiny: i2c_flash: make the firmware path optionalFarouk Bouabid
The flashing tool is now able to retrieve bootloader data. Let's make the user capable of just reading these information through the console without having to flash anything. Relates-to: RNG-147 Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
2023-10-13mule-attiny: i2c_flash: implement bl_data reading from flashloaderFarouk Bouabid
After entering the flashloader mode, clearing the boot request gpio sets the flashloader into read-only mode where the flashing tool can read bootloader data through i2c (i2c-write ops are ignored). This data contain: * Bootloader version This tool will print out all bootloader data to the console. Relates-to: RNG-147 Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
2023-10-13mule-attiny: i2c_flash: support flashloader read-only modeFarouk Bouabid
After entering the flashloader it is safe to set it into read-only mode (by pulling the boot request gpio back low) until the fw_flash() routine is actually called. This avoids having any i2c process, by mistake, write to the wire (flash unwanted/invalid data). Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com>
2023-08-24mule: README.md: OpenOCD: Explicitly state supported modulesDaniel Semkowicz
Explicitly state what modules are supported by openocd.cfg config file to avoid confusion. Relates-to: RNG-10 Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
2023-08-24mule: README.md: OpenOCD: Fix dot characterDaniel Semkowicz
Some exotic character was placed at the end of the sentence instead of dot. Relates-to: RNG-10 Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
2023-08-24mule: README.md: Fix openocd.cfg pathDaniel Semkowicz
openocd.cfg is no longer placed in tools directory. Adjust manual to include correct path. Relates-to: RNG-10 Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
2023-08-24mule: README.md: Add introduction sectionDaniel Semkowicz
Describe shortly what can be found in mule directory. Relates-to: RNG-10 Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
2023-08-22mule: README.md: Add mule.sh dependenciesDaniel Semkowicz
Add subsection with a list of dependencies required by mule.sh script. Relates-to: RNG-10 Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
2023-08-04add GitLab CI for linterQuentin Schulz
This adds a pipeline for using linters. Only flake8 is used for now. alpine/flake8 doesn't start a shell but rather execute flake8 directly. However, GitLab CI seems to start all containers by trying to start a shell: ``` -c if [ -x /usr/local/bin/bash ]; then exec /usr/local/bin/bash elif [ -x /usr/bin/bash ]; then exec /usr/bin/bash elif [ -x /bin/bash ]; then exec /bin/bash elif [ -x /usr/local/bin/sh ]; then exec /usr/local/bin/sh elif [ -x /usr/bin/sh ]; then exec /usr/bin/sh elif [ -x /bin/sh ]; then exec /bin/sh elif [ -x /busybox/sh ]; then exec /busybox/sh else echo shell not found exit 1 fi ``` Since flake8 is the entrypoint, it gets passed this long string which it cannot do anything with (as opposed to the - I guess - expected `sh`). Instead, let's replace the entrypoint of the docker image so that the runner directly passes the script to the container. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 E711 comparison to None should be 'if cond is not None:'Quentin Schulz
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 E712 comparison to True should be 'if cond is True:' ↵Quentin Schulz
or 'if cond:' Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: command_processor.py: import missing moduleQuentin Schulz
time.sleep is used but the time module was never imported, so let's fix that. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: cp2102_simple: fix do_statusQuentin Schulz
The wrong variable names were used for comparison so let's use the proper ones. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 E703 statement ends with a semicolonQuentin Schulz
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 E251 unexpected spaces around keyword / parameter equalsQuentin Schulz
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 E221 multiple spaces before operatorQuentin Schulz
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 E303 too many blank lines (3)Quentin Schulz
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 E128 continuation line under-indented for visual indentQuentin Schulz
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 W391 blank line at end of fileQuentin Schulz
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: fix flake8 302 expected 2 blank lines, found 1Quentin Schulz
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04add global flake8 configurationQuentin Schulz
Take the one from i2c-flash copied during the import and make it the git repository's wide policy. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: typo fix in usageKlaus Goger
Minor change of a typo noticed during usage Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2023-08-04usb-control: print usage if called without argumentKlaus Goger
We should really use argparse, but for now improve the usability by printing the usage help when there is no command provided. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2023-08-04usb-control: use board instead of baseboardKlaus Goger
As we are now also support a SBC (Jaguar) the use of the term baseboard is wrong. Instead be more generic with just board. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2023-08-04usb-control: add script to control JaguarQuentin Schulz
SBC-RK3588-AMR Jaguar is controllable over CP2102 both for its main power and BIOS DISABLE lines, so let's add a wrapper script to make it easier to control the BIOS Disable line state as well as control power reset via USB. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-04usb-control: cp2102_haikou.py: fix biosdisable commandQuentin Schulz
The biosdisable command was mistakenly setting the mode to normal instead of BIOS_DISABLE, let's fix this. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-08-03mule: mule.sh: Add PX30-µQ7 SoM pin configurationDaniel Semkowicz
This change enables support for PX30-µQ7 SoM model. Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
2023-07-06mule-attiny: i2c-flash: specify executables should be in PATHQuentin Schulz
Since `updi_reset` is an executable that needs to be compiled by the user, it's better to explicit it should be made available to the user so that it can be run as any executable, by having it installed in one of the PATH directories or extend `PATH` environment variable to contain the `updi_reset` executable's parent directory. Reported-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-06-29mule-attiny: i2c-flash: fix flake8 issueQuentin Schulz
flake8 reports an issue: E275 missing whitespace after keyword So let's fix it by adding the missing whitespace. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-06-29mule-attiny: i2c-flash: add a console scriptQuentin Schulz
This makes a new console script called `mule-attiny_i2c_flash` available to the user after installing the package which calls the `main` function from the i2c_flash package. Users now just need to call mule-attiny_i2c_flash from anywhere on their system to flash the Mule-ATtiny companion microcontroller over I2C. Relates-to: EHSW-1799 Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-06-29mule-attiny: i2c-flash: put main content into a functionQuentin Schulz
To prepare for making setuptools create a console script for executing the main code, let's put the main code into a function, lazily called `main`. To still allow users to run this script manually, make it call the main function in that event, Relates-to: EHSW-1799 Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-06-29mule-attiny: i2c-flash: reorganize as proper Python projectQuentin Schulz
This should allow for easier integration with build systems such as the Yocto Project or Buildroot. The LICENSE file is a copy of the MIT license file already at the root of the git repository, only with the copyright year changed to this year. At the same time, a README is added to explain what this is useful for. Relates-to: EHSW-1799 Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-06-29import i2c_flash.py for flashing Mule-ATtiny FW over I2CQuentin Schulz
This is an import from https://gitlab.lan/som/mule-attiny/-/tree/4d0bd1eb6e739c82b82443776cd2a612d2bf2d1a/bootloader/utils/scripts/ with a directory rename to `i2c-flash`. Relates-to: EHSW-1799 Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>