summaryrefslogtreecommitdiff
path: root/board
AgeCommit message (Collapse)Author
2023-07-18toradex: tdx-cfg-block: rework display adapter name handlingtoradex_ti-u-boot-2021.01_bringupMax Krummenacher
Rework the rather big array of zero length strings with 4 entries of actual display adapter names to a array of structs which ties a pid4 to its correspondent human readable string. Provide an accessor to get the string for a given PID4. Upstream-Status: Submitted [https://lore.kernel.org/all/20230718090734.20357-4-andrejs.cainikovs@toradex.com/] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
2023-07-18toradex: tdx-cfg-block: rework carrier board name handlingMax Krummenacher
Rework the rather big array of zero length strings with 4 entries of actual carrier board names to a array of structs which ties a pid4 to its correspondent human readable string. Provide an accessor to get the string for a given PID4. Rework the user of the information to use the accessor. Note that check_pid8_sanity() is used for early samples of Dahlia and the development board. Yavia isn't affected. Upstream-Status: Submitted [https://lore.kernel.org/all/20230718090734.20357-3-andrejs.cainikovs@toradex.com/] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
2023-07-18toradex: tdx-cfg-block: add yavia carrier cfg block infoMax Krummenacher
Add the Yavia Carrier board name string to the known carrier board list. Upstream-Status: Submitted [https://lore.kernel.org/all/20230718090734.20357-2-andrejs.cainikovs@toradex.com/] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
2023-06-16toradex: tdx-cfg-block: add verdin am62 launch configuration SKUsEmanuele Ghidoli
Add Verdin am62 SKUs to ConfigBlock handling. Add the following PID4s SOMs: - 0071 Verdin AM62 Solo 512MB - 0072 Verdin AM62 Solo 512MB WB IT - 0073 Verdin AM62 Dual 1GB ET - 0074 Verdin AM62 Dual 1GB IT - 0075 Verdin AM62 Dual 1GB WB IT - 0076 Verdin AM62 Quad 2GB WB IT to the list of Toradex modules Upstream-Status: Pending Series [1] already sent for review and this patch must be applied on top, fixing trivial conflicts. We'll send afterward or update it in case a V3 is needed. [1] https://lore.kernel.org/u-boot/20230612205444.363727-1-marcel@ziswiler.com/ Related-to: ELB-5222 Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
2023-06-01verdin-am62: add memory size autodetectionEmanuele Ghidoli
Add memory size auto-detection, maximum size for Verdin AM62 is 2GB. Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
2023-05-15Revert "board: verdin-am62: allow dfu update"Max Krummenacher
Drop the the dfu update possibility in favour of a follow up Toradex Easy Installer procedure. This reverts commit 6d147efd19e42b03b812392c4bf8eee4e96b2d2d. Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2023-05-05verdin-am62: migrate and sync to using linux kernel device treesMarcel Ziswiler
Migrate and sync to using Linux kernel (albeit still downstream) device trees. Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-05-05Merge tag '08.06.00.007' into toradex_ti-u-boot-2021.01_bringup-ELB-5176Marcel Ziswiler
Merge TI U-Boot RC Release 08.06.00.007
2023-03-20verdin-am62: enable the 32kHz clock inputMax Krummenacher
Set the LFOSC0 mode to bypass. This makes the external provided 32kHz clock available. A noteable consumer is the AM62x internal RTC. Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2023-02-23board: ti: am62ax: evm.c: Add EEPROM associated featuresSiddharth Vadapalli
Add functions to support features such as detecting the board from the EEPROM as well as fetching the MAC address from EEPROM. Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2023-02-22board: verdin-am62: allow dfu updateMax Krummenacher
Detect if U-Boot proper was booted from DFU, if so start DFU for flashing U-boot to eMMC boot area followed by UMS for flashing eMMC user area. Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Refactoring ideas: - `Detect DFU boot` moved into arch K3 specific code. - `Detect DFU boot` by DFUing to a 'DFU' address a magic pattern and test that address. - Have a special U-Boot configuration for DFU boots,. - With TEZI available for Verdin AM62 this commit can be dropped. - The TEZI U-Boot could then have in its boot flow: ... if (! dfu_boot()) load_the_TEZI_fitimage_from_eMMC(); boot_from_fitimage(); ... Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2023-02-21board: ti:am62x: Drop duplicate boot_fit var updateVignesh Raghavendra
This is already handled as part of misc_init_r() under mach-k3 common code. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2023-02-21board: toradex: verdin-am62: set pmic buck1 +vdd_core to 850 mVMarcel Ziswiler
Set PMIC Buck1 aka +VDD_CORE to 850 mV as required to operate the AM625 at its highest operating point of 1.4 GHz. Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21board: toradex: add verdin am62 supportMarcel Ziswiler
This adds initial support for the Toradex Verdin AM62 Quad 1GB WB IT V1.0A module. They are strapped to boot from their on-module eMMC. U-Boot supports booting from the on-module eMMC, or, via separate verdin-am62_r5_usbdfu_defconfig from USB DFU based recovery mode. Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: tdx-cfg-block: add 0069 verdin am62 quad 1gb wb itMarcel Ziswiler
Add initial Verdin AM62 Quad 1GB WB IT prototype SKU to ConfigBlock handling. 0069: Verdin AM62 Quad 1GB WB IT Upstream-Status: Pending Initial U-Boot to be used for bring-up and validation of the V1.0 design, we'll decide on the step forward to mainline this once the bring-up and validation will be done. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: common: Improve product/serial print during bootFrancesco Dolcini
Add product id print in show_board_info(), with an increasing number of Toradex SKUs available with small differences it makes sense to print it. Move serial number print to a dedicated line, this prevents the previous line with the product name to overflow the 80 columns with any reasonable product name length. Upstream-Status: Backport [abe52f58bc54efa9a9849ad4246666ae0be94d38] Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-02-21toradex: tdx-cfg-block: Use official SKU namesFrancesco Dolcini
Up to now in the code we named Toradex SKUs in a slightly different way compared to the official product name, start using the official names from now on to avoid misunderstanding. This has also the nice benefit of the string being shorter, allowing to fit nicely in 80 columns even adding the product ID when printing the hardware information. Upstream-Status: Backport [4f0c33c46d946beb5e3430ce694d86ff86adbfcd] Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-02-21toradex: common: Remove #ifdef usage for 2nd ethaddrFrancesco Dolcini
Fix checkpatch warn, use `IS_ENABLED(CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR)` instead of `#ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR`. Upstream-Status: Backport [9762fbeea451f4d81ec88788e7680e37a1ee5beb] Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-02-21toradex: common: Remove stale function declarationFrancesco Dolcini
Remove stale show_boot_logo() declaration, not used anywhere. Fixes: e6fd30dd9eef ("toradex: drop legacy show_boot_logo function and use splashscreen") Upstream-Status: Backport [0d4b692c807881253ec6954970ccbb0f717ae10a] Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-02-21toradex: tdx-cfg-block: Cleanup interactive cfg block creationFrancesco Dolcini
Simplify interactive config block creation code, instead of having a a long list of questions and a complex tree of preprocessor directive to guess the exact SKU, just ask the user to select it from a list. The modules list is filtered out to include only SKUs that are supported by the specific u-boot binary in execution. Upstream-Status: Backport [8b6dc5d3943c269892acb2a426ad4a46a7f7fc49] Due to missing dectoul() rely on simple_strtoul() instead. Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-02-21toradex: common: Use ARRAY_SIZE macroFrancesco Dolcini
Use generally available ARRAY_SIZE macro, instead of hand-coding it every time is needed. Upstream-Status: Backport [cdc39c6aaea33a9a47657f7798090ca973053a2f] Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-02-21toradex: common: Remove stale comments about modules availabilityFrancesco Dolcini
Remove comment "not currently on sale" on specific SKUs, this information does not belong to the code and will never be accurate. Upstream-Status: Backport [ea1dc32f318903340a5ddaa8dc655503d1b4599e] Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-02-21toradex: tdx-cfg-block: add 0068 i.mx 8m mini skuPhilippe Schenker
Add new i.MX 8M Mini SKU to ConfigBlock handling. 0068: Verdin iMX8M Mini Quad 2GB WB IT No CAN This SKU is identical to 0055 but without CAN. Mention this in the name so those modules can be distinguished. Upstream-Status: Backport [a2da29a4e2a0adac38dba2ebbb539ce52898d078] Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-02-21toradex: tdx-cfg-block: add new toradex oui rangePhilippe Schenker
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. Upstream-Status: Backport [1cf4e79f5776e9cc451b7f4affec7e47db9533f9] Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Reviewed-by: Fabio Estevam <festevam@denx.de> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: tdx-cfg-block: extend assembly versionPhilippe Schenker
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 Upstream-Status: Backport [7e27ce16c5d289e5b9712a179e798ea4eb831816] Due to missing dectoul() rely on simple_strtoul() instead. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: tdx-cfg-block: use defines for string lengthPhilippe Schenker
With those defines the length can be reused and is in one place extendable. Upstream-Status: Backport [494ef10c3bf7859e7d21d9e1d608dc0b634451c2] Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: tdx-cfg-block: use only snprintfPhilippe Schenker
Prevent memory issues that could appear with sprintf. Replace all sprintf occurences with snprintf. Upstream-Status: Backport [39ff0624bc5ad287fced0f60be9b977d07b1813a] Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: tdx-cfg-block: add new 8gb apalis-imx8Philippe Schenker
0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT This module is identical to its 4GB counterpart 0037: Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT except for the RAM size. Upstream-Status: Backport [4941035143a467bb356af7bfe6bfe3f04b2186f1] Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21board: toradex: drop colibri pxa270 supportMarcel Ziswiler
The Colibri PXA270 has been end-of-life since quite a while and would require more and more maintenance (e.g. DM conversions). Upstream-Status: Backport [fc102c87c11dfd52039326534ff831d3edd8340d] Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: apalis-imx8x: drop support for apalis imx8xDenys Drozdov
Drop Apalis iMX8X platform as it never left sample state and is no longer supported. Upstream-Status: Backport [47bcc0d056aa243a31d2a1edb44bdcd155f5335b] Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: tdx-cfg-block: add new i.mx 6ull and 8m plus skusMarcel Ziswiler
Add new i.MX 6ULL and 8M Plus SKUs to ConfigBlock handling: 0062: Colibri iMX6ULL 1GB IT (eMMC) 0063: Verdin iMX8M Plus Quad 4GB IT 0064: Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT 0065: Verdin iMX8M Plus QuadLite 1GB IT 0066: Verdin iMX8M Plus Quad 8GB Wi-Fi / BT Upstream-Status: Backport [c9585087bc556eb15f04a76ae4a216b2e565cc51] Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: configblock: fix interactive mode it handlingDenys Drozdov
Restore "Is the module an IT version? [y/N]" for "cfgblock create" interactive mode command, which was leading to invalid detection of 0051 Colibri iMX8DX 1GB WB module; Fixes: a5b5ad4d859b ("toradex: tdx-cfg-clock: add new i.mx 8m mini/plus skus") Related-to: ELB-3482 Upstream-Status: Backport [ab98ebf79cd4b8beaed02bfd024f4fc290f4da00] Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-02-21toradex: configblock: 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 all digits of PID8 to store module revision. Upstream-Status: Backport [fd90aca329a37eade4187ca886a8dea5c60aaba0] Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
2023-02-14board: ti: j784s4: Add support for detecting multiple device treesDasnavis Sabiya
Update the board_fit_config_name_match() to choose the dtb based on the board name read from EEPROM. Restrict multpile EEPROM reads by verifying if EEPROM is already read. Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-02-14board: ti: j784s4: Add support to update board_name for am69-skDasnavis Sabiya
Update setup_board_eeprom_env() to choose the right board name for am69-sk. Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-02-14board: ti: j784s4: Update EEPROM address for AM69 SKDasnavis Sabiya
J784S4 EVM has EEPROM populated at 0x50. AM69 SK has EEPROM populated at next address 0x51. So start looking for TI specific EEPROM at 0x50, if not found look for EEPROM at 0x51. Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-02-08board: ti: am62x: Add daughter card detection supportNitin Yadav
Add support to probe connected daughter cards, select appropriate overlays for kernel boot up based on add-on cards detected. Signed-off-by: Nitin Yadav <n-yadav@ti.com>
2023-01-19board: ti: common: board_detect: Fix EEPROM read quirk for 2-byteNeha Malcom Francis
EEPROM detection logic in ti_i2c_eeprom_get() involves figuring out whether addressing is 1-byte or 2-byte. There are currently different behaviours seen across boards as documented in commit 769893c301ec ("board: ti: common: board_detect: Fix EEPROM read quirk"). Adding to the list, we see that there are 2-byte EEPROMs that read properly with 1-byte addressing with no offset. For ti_i2c_eeprom_am6_get where eeprom parse operation is dynamic, the earlier commit 1c0d06c606ab ("board: ti: common: board_detect: Fix EEPROM read quirk for AM6 style data") tried to resolve this by running ti_i2c_eeprom_get() twice. However this commit along with its former commit fails on J7 platforms where EEPROM successfully return back the header on 1-byte addressing and continues to do so until an offset is introduced. So the second read incorrectly determines the EEPROM as 1-byte addressing. A more generic solution is introduced here to solve this issue: 1-byte read without offset and 1-byte read with offset. If both passes, it follows 1-byte addressing else we proceed with 2-byte addressing check. Tested on J721E, J7200 Signed-off-by: Neha Malcom Francis <n-francis@ti.com> Fixes: 1c0d06c606ab (board: ti: common: board_detect: Fix EEPROM read quirk for AM6 style data) Fixes: 769893c301ec (board: ti: common: board_detect: Fix EEPROM read quirk)
2023-01-17board: ti: j721s2: Add board_init and support for selecting DT based on EEPROMSinthu Raja
Add the board_init_f API for SPL and run the platform-required SoC initialization. Add the functionality for board name-based DTB selection from FIT within SPL. This will make it easier to utilise one defconfig for both the EVM and the SK. Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
2023-01-17board: ti: j721s2: Add support for detecting multiple device treesSinthu Raja
Update the board_fit_config_name_match() to choose the right dtb based on the board name read from EEPROM. Also restrict multpile EEPROM reads by verifying if EEPROM is already read Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
2023-01-17board: ti: j721s2: Disable probing of daughtercardsSinthu Raja
AM68-sk doesn't have any daughter cards, so disable daughter card probing inside board_late_init() for am68-sk. Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
2023-01-17board: ti: j721s2: Enable support for reading EEPROM at next alternate addressSinthu Raja
J721S2 EVM has EEPROM populated at 0x50. AM68 SK has EEPROM populated at next address 0x51 in order to be compatible with RPi. So start looking for TI specific EEPROM at 0x50, if not found look for EEPROM at 0x51. Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
2023-01-17board: ti: j721s2: Add support to update board_name for am68-skSinthu Raja
Update setup_board_eeprom_env() to choose the right board name for am68-sk. Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
2023-01-11board: ti: am62ax: evm.c: Add board init to support USB DFUBryan Brattlof
Set the USB PHY core voltage to 0.85V Signed-off-by: Bryan Brattlof <bb@ti.com> Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
2022-12-01board: ti: introduce the basic files needed to support the am62aBryan Brattlof
Introduce the bare minimum SD and UART support for the am62a sk. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Bryan Brattlof <bb@ti.com>
2022-11-21j721e: j7200: serdes: evm: Switch to using R5/A72 config to configure serdesNeha Malcom Francis
Instead of relying on EEPROM reads to figure out board type in order to configure SERDES driver for J7200 and J721E, use CONFIG_TARGET_{SOC}_{R5/A72}_EVM instead. Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2022-11-18board: ti: am62x: update name for AM62X-LP-SKGuillaume La Roque
Actually am625-sk and am62x-lp-sk board use same board_name. We need to know for android support exact name of board to know which device tree we need to load. Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
2022-10-21board: ti: common: board_detect: Fix EEPROM read quirk for AM6 style dataNishanth Menon
commit d2ab2a2bafd53ace79da900900d5220931c7ef5a upstream. The situation is similar to commit bf6376642fe8 ("board: ti: common: board_detect: Fix EEPROM read quirk"). This is seen on a variant of eeproms seen on some BeagleBone-AI64 which now has a mix of both 1 byte addressing and 2 byte addressing eeproms. Unlike the am335x (ti_i2c_eeprom_am_get) and dra7 (ti_i2c_eeprom_dra7_get) which use constant data structure which allows us to do a complete read of the data, the am6(ti_i2c_eeprom_am6_get) eeprom parse operation is dynamic. This removes the option of being able to read the complete eeprom data in one single shot. Fortunately, on the I2C bus, we do see the following behavior: In 1 byte mode, if we attempt to read the first header data yet again, the misbehaving 2 byte addressing device acts in constant addressing mode which results in the header not matching up and follow on attempt at 2 byte addressing scheme grabs the correct data. This costs us an extra ~3 milliseconds, which is a minor penalty compared to the consistent image support we need to have. Reported-by: Jason Kridner <jkridner@beagleboard.org> Fixes: a58147c2dbbf ("board: ti: common: board_detect: Do 1byte address checks first.") Signed-off-by: Nishanth Menon <nm@ti.com>
2022-10-21board: ti: common: board_detect: Fix EEPROM read quirkMatwey V. Kornilov
commit bf6376642fe8295f887144999713ebe644388205 upstream. There are three different kinds of EEPROM possibly present on boards. 1. 1byte address. For those we should avoid 2byte address in order not to rewrite the data. Second byte of the address can potentially be interpreted as the data to write. 2. 2byte address with defined behaviour. When we try to use 1byte address they just return "FF FF FF FF ... FF" 3. 2byte address with undefined behaviour (for instance, 24LC32AI). When we try to use 1byte address, then their internal read pointer is changed to some value. Subsequential reads may be broken. To gracefully handle both case #1 and case #3 we read all required data from EEPROM at once (about 80 bytes). So either all the data is valid or we fallback to 2byte address. Cc: Nishanth Menon <nm@ti.com> Fixes: a58147c2dbbf ("board: ti: common: board_detect: Do 1byte address checks first.") Reference: https://lore.kernel.org/all/CAJs94Ebdd4foOjhGFu9Bop0v=B1US9neDLxfhgcY23ukgLzFOQ@mail.gmail.com/ Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> Acked-by: Nishanth Menon <nm@ti.com>
2022-10-21board: ti: common: board_detect: Do 1byte address checks first.Nishanth Menon
commit a58147c2dbbfbc436ba84463678e943146bcae7d upstream. Do 1 byte address checks first prior to doing 2 byte address checks. When performing 2 byte addressing on 1 byte addressing eeprom, the second byte is taken in as a write operation and ends up erasing the eeprom region we want to preserve. While we could have theoretically handled this by ensuring the write protect of the eeproms are properly managed, this is not true in case where board are updated with 1 byte eeproms to handle supply status. Flipping the checks by checking for 1 byte addressing prior to 2 byte addressing check prevents this problem at the minor cost of additional overhead for boards with 2 byte addressing eeproms. Signed-off-by: Nishanth Menon <nm@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>