summaryrefslogtreecommitdiff
path: root/board/toradex/common/tdx-cfg-block.c
AgeCommit message (Collapse)Author
2024-01-24toradex: tdx-cfg-block: Add new apalis and colibri pidtoradex_2020.07Joao Paulo Goncalves
Add new apalis imx6 and colibri imx6/imx7 products IDs. Upstream-Status: Submitted [https://lore.kernel.org/u-boot/20240122200930.673447-1-jpaulo.silvagoncalves@gmail.com/] Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2022-06-20toradex: tdx-cfg-block: add new toradex oui rangePhilippe Schenker
[ backported from https://lists.denx.de/pipermail/u-boot/2022-June/486993.html ] Add new Toradex MAC OUI (8c:06:cb), to the config block. With this change we extend the possible serial-numbers as follows: For serial-numbers 00000000-16777215 OUI 00:14:2d is taken For serial-numbers 16777216-33554431 OUI 8c:06:cb is taken Lower 24-bit of the serial number are used in the NIC part of the MAC address, the complete serial number can be calculated using the OUI. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> [ps: use kdiff3 to autoresolve conflicts]
2022-06-14toradex: tdx-cfg-block: extend assembly versionPhilippe Schenker
i[ backport https://lists.denx.de/pipermail/u-boot/2022-June/486350.html ] There are two decimal digits reserved to encode the module version and revision. This code so far implemented A-Z which used 0-25 of this range. This commit extends the range to make use of all 99 numbers. After capital letters the form with a hashtag and number (e.g. #26) is used. Examples: If the assembly version is between zero and 25 the numbering is as follows, as it also has been before this commit: 0: V0.0A 1: V0.0B ... 25: V0.0Z New numbering of assembly version: If the number is between 26 and 99 the new assembly version name is: 26: V0.0#26 27: V0.0#27 ... 99: V0.0#99 Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> [ps: backport: replace dectoul() with simple_strtoul()]
2021-09-06cfgblock: extend get_cfgblock_interactiveOleksii Bidnichenko
- Correct the hardware product id for the Colibri IMX7D (eMMC) module. - Exclude IT check since Colibri IMX7D (eMMC) is always IT. Related-to: ELB-4076 Signed-off-by: Oleksii Bidnichenko <oleksii.bidnichenko@toradex.com>
2021-07-29toradex: tdx-cfg-block: add colibri imx6ull emmc variantMax Krummenacher
While at it complete the list of the known module product ids. Related-to: ELB-4056, ELB-4057 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-07-29toradex: tdx-cfg-block: fix verdin handlingMax Krummenacher
| #if !defined(CONFIG_TARGET_VERDIN_IMX8MM) || !defined(CONFIG_TARGET_VERDIN_IMX8MN) is never false. Fix that so that the condition is 'true' for any board but the two verdins. Fixes commit c0c3978cba3 ("toradex: tdx-cfg-block: add Verdin iMX8M Mini/Nano support"). Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2021-04-01apalis_imx6: fix module revision in config blockDenys Drozdov
U-boot might display wrong module revision information for modules with an assembly version 'K'. "cfgblock create" does not takes into account all revision digits from PID8. This fix takes into account 6th,7th digits of PID8 to store module revision. Related-to: ELB-3893 Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
2020-07-20toradex: tdx-cfg-clock: add migration routine from PID8Igor Opaniuk
Add migration routine from PID8 pre-stored values on EEPROM (including sane value checks). Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2020-07-20toradex: tdx-cfg-block: add support for EEPROMIgor Opaniuk
This introduces support for EEPROM as a storage for the main Toradex config block and additional config blocks on extra EEPROM chips (on carrier board or video adapters). To enable EEPROM as a storage for the main config block: TDX_HAVE_EEPROM=y. For additional EEPROMs please enable this Kconfig symbol: TDX_CFG_BLOCK_EXTRA=y. Information about existing EEPROM chips is provided via Device Tree using aliases. You can also write configuration for the carrier board using create_carrier subcommand for cfgblock. Example: Verdin iMX8MM # cfgblock create_carrier Supported carrier boards: UNKNOWN CARRIER = [0] Verdin Carrier Board = [1] Choose your carrier board (provide ID): 1 Enter carrier board version (e.g. V1.1B): V1.0A Enter carrier board serial number: 10622780 Also with barcode: Verdin iMX8MM # cfgblock create carrier -y 0156100010622780 Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2020-07-20toradex: tdx-cfg-block: add carrier boards and display adaptersIgor Opaniuk
Add defines for supported carrier boards and display adapters. Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2020-05-18command: Remove the cmd_tbl_t typedefSimon Glass
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop net.h from common headerSimon Glass
Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-09toradex: tdx-cfg-block: add Verdin iMX8M Mini/Nano supportMarcel Ziswiler
Add support for storing configuration for Verdin iMX8M Mini and Nano SoMs in Toradex config block. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2020-02-09toradex: tdx-cfg-block: add Apalis iMX8X supportMarcel Ziswiler
Add support for storing configuration for Apalis iMX8X SoM in Toradex config block. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2019-08-11env: Move env_get() to env.hSimon Glass
Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-19toradex: configblock: avoid line continuationsMarcel Ziswiler
Fix issue as reported by checkpatch.pl. Leave long lines as line continuation in text output is not recommended. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2019-07-19toradex: configblock: fix apalis imx8 targetMarcel Ziswiler
The Apalis iMX8 was missing the interactive part should a customer have bricked his module and want to re-create the configuration block. Fix this. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2019-07-19toradex: configblock: fix colibri imx8x targetMarcel Ziswiler
The Colibri iMX8X target got re-named late in the cycle which we forgot to reflect here. Furthermore, it was missing the interactive part should a customer have bricked his module and want to re-create the configuration block. Fix this. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2019-07-19toradex: configblock: generic wi-fi/bt handlingMarcel Ziswiler
Make the interactive Wi-Fi/BT handling generic by pulling it out of the Colibri iMX6ULL interactive part to be re-used for Apalis iMX8 and Colibri iMX8X. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2019-07-19toradex: configblock: initialize MMC before switching partitionStefan Agner
If the module is in serial downloader mode, we do no longer read the environment from eMMC. Therefor, the eMMC is unitialized when trying to read the config block. Use mmc_init to initialize the selected MMC device before using it. Note: In case the MMC has already been initialized, the mmc_init detects that and returns immediately. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2019-04-25board: toradex: tdx-cfg-block: add new skusMarcel Ziswiler
Add all the latest new SKUs: - Apalis iMX8 QuadXPlus 2GB Wi-Fi / BT IT - Apalis iMX8 QuadMax 4GB IT - Apalis iMX8 QuadPlus 2GB Wi-Fi / BT - Apalis iMX8 QuadPlus 2GB", - Colibri iMX8 QuadXPlus 2GB IT - Colibri iMX8 DualX 1GB Wi-Fi / Bluetooth - Colibri iMX8 DualX 1GB Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-04-25board: toradex: tdx-cfg-block: clean-up sku handlingMarcel Ziswiler
Clean-up handling of several SKUs. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-04-25tdx-cfg-block: simplify i.MX 6 module detectionStefan Agner
Use CONFIG_TARGET_... at compile time to differentiate between Apalis iMX6, Colibri iMX6 and Colibri iMX6ULL. Avoid code duplication by moving question about Wi-Fi / Bluetooth before IT/non-IT decision. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-04-25tdx-cfg-block: add support for new colibri iMX6ull skusGerard Salvatella
Add support for new Colibri iMX6ULL SKUs. While at it also checkpatch fix the whole files. Signed-off-by: Gerard Salvatella <gerard.salvatella@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-04-13tdx-cfg-block: fix off by one issueMarcel Ziswiler
Fix toradex_modules array off by one issue potentially leading to spurious printout during boot e.g. Model: Toradex V1.2A, instead of Model: Toradex UNKNOWN MODULE V1.2A. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-04-13toradex: configblock: add an -y parameter to 'cfgblock create’Dominik Sliwa
Add an optional -y parameter to 'cfgblock create’ to simplify automation. Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2018-09-04board: toradex: common: fail gracefully on missing NAND chipStefan Agner
If the NAND chip is missing get_nand_dev_by_index() returns NULL. Fail gracefully in this case. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2018-07-23board: toradex: add new and upcoming SKUsStefan Agner
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-15blk: Remove various places that do flush cache after readBin Meng
All these places seem to inherit the codes from the MMC driver where a FIXME was put in the comment. However the correct operation after read should be cache invalidate, not flush. The underlying drivers should be responsible for the cache operation. Remove these codes completely. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: York Sun <york.sun@nxp.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: York Sun <york.sun@nxp.com>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11board: toradex: use get_nand_dev_by_index()Grygorii Strashko
As part of preparation for nand DM conversion the new API has been introduced to remove direct access to nand_info array. So, use it here instead of accessing to nand_info array directly. Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
2017-06-05arm: Add explicit include of <asm/mach-types.h>Simon Glass
Rather than relying on common.h to provide this include, which is going away at some point, include it explicitly in each file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-06-01tegra: Convert MMC to use driver model for operationsSimon Glass
Enable CONFIG_DM_MMC_OPS and CONFIG_BLK for all Tegra devices. This moves Tegra to use driver model fully for MMC. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-11-28toradex: config block handlingMarcel Ziswiler
Add Toradex factory configuration block handling. The config block is a data structure which gets stored to flash during production testing. The structure holds such information as board resp. hardware revision, product ID and serial number which is used as the NIC part of the Ethernet MAC address as well. The config block will be read upon boot by the show_board_info() function, displayed as part of the board information and passed to Linux via device tree or ATAGs. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>