summaryrefslogtreecommitdiff
path: root/include/cros_board_info.h
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesstabilize-quickfix-15278.72.B-ishstabilize-quickfix-15183.78.B-ishstabilize-15446.B-ishstabilize-15439.B-ishstabilize-15432.B-ishstabilize-15429.B-ishstabilize-15415.B-ishstabilize-15395.B-ishstabilize-15393.48.B-ishstabilize-15381.B-ishstabilize-15364.B-ishstabilize-15361.B-ishstabilize-15359.B-ishstabilize-15359.58.B-ishstabilize-15359.50.B-ishstabilize-15359.45.B-ishstabilize-15335.B-ishstabilize-15329.59.B-ishstabilize-15329.44.B-ishstabilize-15317.B-ishstabilize-15301.B-ishstabilize-15300.B-ishstabilize-15278.64.B-ishstabilize-15251.B-ishstabilize-15245.B-ishstabilize-15236.66.B-ishstabilize-15208.B-ishstabilize-15207.B-ishstabilize-15185.B-ishstabilize-15185.7.B-ishstabilize-15183.82.B-ishstabilize-15183.69.B-ishstabilize-15183.14.B-ishstabilize-15174.B-ishstabilize-15167.B-ishstabilize-15129.B-ishstabilize-15122.B-ishstabilize-15120.B-ishstabilize-15117.86.B-ishstabilize-15117.48.B-ishstabilize-15117.111.B-ishrelease-R114-15437.B-ishrelease-R113-15393.B-ishrelease-R112-15359.B-ishrelease-R111-15329.B-ishrelease-R110-15278.B-ishrelease-R109-15237.B-ishrelease-R109-15236.B-ishrelease-R108-15183.B-ishrelease-R107-15117.B-ishishfirmware-ti50-prepvt-15315.B-ishfirmware-skyrim-15390.B-ishfirmware-skyrim-15369.B-ishfirmware-nissa-15217.B-ishfirmware-nissa-15217.45.B-ishfirmware-nissa-15217.126.B-ishfirmware-duplo-15151.B-ishfirmware-corsola-15194.B-ishfactory-trogdor-15210.B-ishfactory-skyrim-15384.B-ishfactory-nissa-15199.B-ishfactory-corsola-15197.B-ishfactory-corsola-15196.B-ishfactory-brya-15231.B-ishMike Frysinger2022-09-141-1/+1
| | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: I5b357b85ae9473a192b80983871bef4ae0d4b16f Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3893394 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* cbi: Add CONFIG_EEPROM_CBI_WPAseda Aboagye2021-07-291-0/+9
| | | | | | | | | | | | | | | | | | | | | This commit adds the config option, CONFIG_EEPROM_CBI_WP. It is to be defined when the EC directly controls the CBI EEPROM WP signal. The EC will set the WP according to the result of `system_is_locked()`. Note that once the WP is set, the EC must be reset via EC_RST_ODL in order for the WP to become unset. This is enabled by the accompanying hardware. BUG=b:181769483 BRANCH=None TEST=`make -j buildall` Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: If490594ab4dd24af98119b01299215b997913b66 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3046412 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* cbi: Introduce CONFIG_CBI_GPIOPhilip Chen2021-07-141-0/+12
| | | | | | | | | | | | | | | | | | | For the boards where SKU_ID/BRD_ID comes from the strapping pins on EC, this new config enables AP to ask EC for those hardware configs using the CBI host command `EC_CMD_GET_CROS_BOARD_INFO`. BRANCH=None BUG=b:186264627 TEST=make buildall -j TEST=Enabled CONFIG_CBI_GPIO for lazor and manually verified with `ectool cbi get`. Change-Id: I7ec9097bab96d2076d9d42db2d003460db000113 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002452 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* cbi: Add cbi_get_cache_status()Philip Chen2021-07-031-0/+5
| | | | | | | | | | | | | | | | Implement a new API cbi_get_cache_status() for us to probe CBI cache status in unit tests and anywhere else. BRANCH=None BUG=b:186264627 TEST=make buildall -j Signed-off-by: Philip Chen <philipchen@google.com> Change-Id: Ibe3af7df4f04abe2d65b31f2d604dbb6044e5863 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002448 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* cbi: Remove cbi_eeprom.hPhilip Chen2021-07-021-2/+2
| | | | | | | | | | | | | | | | Move the declaration of cbi_config to cros_board_info.h so that we can get rid of cbi_eeprom.h. BRANCH=None BUG=b:186264627 TEST=make buildall -j Change-Id: I6780542c6428090117d879945d901fe82ce999f4 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002446 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* cbi: Separate CBI EEPROM driver from CBI protocolPhilip Chen2021-06-291-4/+43
| | | | | | | | | | | | | | | | | Factor out the physical storage driver (cbi_eeprom.c) from the CBI data/protocol layer (cbi.c), setting up the groundwork to support more options of CBI sources. BRANCH=None BUG=b:186264627 TEST=make buildall -j Change-Id: Ic30a6f789970dd6723cf70d4e852ddb7161f796f Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965848 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* cbi: API for EC to update fw_config tagScott Collyer2021-04-101-0/+14
| | | | | | | | | | | | | | | | | | This CL adds an API to the CBI to allow the EC to update the FW_CONFIG tag field. This API is dependent on not having a the chipset task defined. BUG=b:164157329 BRANCH=quiche TEST=Verified on quiche that long button presses toggle bit 0 of the FW_CONFIG field. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I3a4360b32feac4a04fe53b518c122940f4b340f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2776227 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* CBI: Add rework_id fieldstabilize-rust-13795.B-mainThejaswani Puta thejaswani.putta@intel.com2021-02-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This field will be used to describe all the reworks performed on a board which includes the mandatory, optional and feature reworks. Also modified existing command handlers under ectool and cbi-util tool to support 64 bit length data. Includes build fix for targets where long int is not 64 bits. BUG: b:170385859 BUILD TEST: make BOARD=<BOARD_NAME> -j; make runfuzztests make runhosttests setup_board, cros_workon & emerge-<32-bit target> ec-utils TEST: ./cbi-util create --file ~/cbi_image --board_version 1 --oem_id 2 --sku_id 255 --dram_part_num "01654329efghac" --model_id 15 --rework_id 123456789123456712 --size 256 CBI image is created successfully TEST: ./cbi-util show --file ~/cbi_image CBI image: /home/thejaswani/cbi_image TOTAL_SIZE: 47 Data Field: name: value (hex, tag, size) BOARD_VERSION: 1 (0x1, 0, 1) OEM_ID: 2 (0x2, 1, 1) SKU_ID: 255 (0xff, 2, 1) MODEL_ID: 15 (0xf, 5, 1) REWORK_ID: 123456789123456712 (0x1b69b4bacd05ec8, 9, 8) DRAM_PART_NUM: 01654329efghac (3, 15) Data validated successfully TEST: hexdump -C ~/cbi_image 00000000 43 42 49 1e 00 00 2f 00 00 01 01 01 01 02 02 01 |CBI.../.........| 00000010 ff 05 01 0f 09 08 c8 5e d0 ac 4b 9b b6 01 03 0f |.......^..K.....| 00000020 30 31 36 35 34 33 32 39 65 66 67 68 61 63 00 ff |01654329efghac..| 00000030 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| * 00000100 TEST: localhost ~ # ectool cbi set 9 98765432 8 localhost ~ # ectool cbi get 9 As uint: 98765432 (0x5e30a78) As binary: 78 0a e3 05 00 00 00 00 localhost ~ # ectool cbi set 9 123456789123456712 8 localhost ~ # ectool cbi get 9 As uint: 123456789123456712 (0x1b69b4bacd05ec8) As binary: c8 5e d0 ac 4b 9b b6 01 localhost ~ # ectool cbi set 9 1234 2 localhost ~ # ectool cbi get 9 As uint: 1234 (0x4d2) As binary: d2 04 TEST: > cbi(from EC Console) 2021-01-19 20:59:56 [80.979692 CBI Reading board info] 2021-01-19 20:59:56 CBI_VERSION: 0x0000 2021-01-19 20:59:56 TOTAL_SIZE: 54 2021-01-19 20:59:56 BOARD_VERSION: 1 (0x1) 2021-01-19 20:59:56 OEM_ID: (Error 1) 2021-01-19 20:59:56 MODEL_ID: (Error 1) 2021-01-19 20:59:56 SKU_ID: 655361 (0xa0001) 2021-01-19 20:59:56 FW_CONFIG: 199683 (0x30c03) 2021-01-19 20:59:56 PCB_SUPPLIER: (Error 1) 2021-01-19 20:59:56 SSFC: (Error 1) 2021-01-19 20:59:56 REWORK_ID: 1234 (0x4d2) 2021-01-19 20:59:56 43 42 49 8c 00 00 36 00 00 01 01 02 04 01 00 0a |CBI...6.........| 2021-01-19 20:59:56 00 06 04 03 0c 03 00 03 19 4d 54 35 33 45 35 31 |.........MT53E51| 2021-01-19 20:59:56 32 4d 36 34 44 34 4e 57 2d 30 34 36 20 57 54 3a |2M64D4NW-046 WT:| 2021-01-19 20:59:56 45 00 09 02 d2 04 ff ff ff ff ff 7f ff ff ff ff |E...............| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2020-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| Signed-off-by: Thejaswani Puta <thejaswani.putta@intel.com> Change-Id: I073a119d43c94cd266503a0fc972a62134b3385f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2693746 Tested-by: Thejaswani Putta <thejaswani.putta@intel.corp-partner.google.com> Commit-Queue: Thejaswani Putta <thejaswani.putta@intel.corp-partner.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Revert "CBI: Add rework_id field"Peter Marheine2021-02-101-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 48ce00b56ce350cbec0e67b1b489aaa145c2b3a4. Reason for revert: fails to build on targets where unsigned long is not 64 bits BUG: chromium:1176495 Original change's description: > CBI: Add rework_id field > > This field will be used to describe all the reworks performed on > a board which includes the mandatory, optional and feature reworks. > > Also modified existing command handlers under ectool and cbi-util tool > to support 64 bit length data. > > BUG: b:170385859 > TEST: ./cbi-util create --file ~/cbi_image --board_version 1 > --oem_id 2 --sku_id 255 --dram_part_num "01654329efghac" > --model_id 15 --rework_id 123456789123456712 --size 256 > CBI image is created successfully > > TEST: ./cbi-util show --file ~/cbi_image > CBI image: /home/thejaswani/cbi_image > TOTAL_SIZE: 47 > Data Field: name: value (hex, tag, size) > BOARD_VERSION: 1 (0x1, 0, 1) > OEM_ID: 2 (0x2, 1, 1) > SKU_ID: 255 (0xff, 2, 1) > MODEL_ID: 15 (0xf, 5, 1) > REWORK_ID: 123456789123456712 (0x1b69b4bacd05ec8, 9, 8) > DRAM_PART_NUM: 01654329efghac (3, 15) > Data validated successfully > > TEST: hexdump -C ~/cbi_image > 00000000 43 42 49 1e 00 00 2f 00 00 01 01 01 01 02 02 01 |CBI.../.........| > 00000010 ff 05 01 0f 09 08 c8 5e d0 ac 4b 9b b6 01 03 0f |.......^..K.....| > 00000020 30 31 36 35 34 33 32 39 65 66 67 68 61 63 00 ff |01654329efghac..| > 00000030 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > * > 00000100 > > TEST: > localhost ~ # ectool cbi set 9 98765432 8 > localhost ~ # ectool cbi get 9 > As uint: 98765432 (0x5e30a78) > As binary: 78 0a e3 05 00 00 00 00 > > localhost ~ # ectool cbi set 9 123456789123456712 8 > localhost ~ # ectool cbi get 9 > As uint: 123456789123456712 (0x1b69b4bacd05ec8) > As binary: c8 5e d0 ac 4b 9b b6 01 > > localhost ~ # ectool cbi set 9 1234 2 > localhost ~ # ectool cbi get 9 > As uint: 1234 (0x4d2) > As binary: d2 04 > > TEST: > > cbi(from EC Console) > 2021-01-19 20:59:56 [80.979692 CBI Reading board info] > 2021-01-19 20:59:56 CBI_VERSION: 0x0000 > 2021-01-19 20:59:56 TOTAL_SIZE: 54 > 2021-01-19 20:59:56 BOARD_VERSION: 1 (0x1) > 2021-01-19 20:59:56 OEM_ID: (Error 1) > 2021-01-19 20:59:56 MODEL_ID: (Error 1) > 2021-01-19 20:59:56 SKU_ID: 655361 (0xa0001) > 2021-01-19 20:59:56 FW_CONFIG: 199683 (0x30c03) > 2021-01-19 20:59:56 PCB_SUPPLIER: (Error 1) > 2021-01-19 20:59:56 SSFC: (Error 1) > 2021-01-19 20:59:56 REWORK_ID: 1234 (0x4d2) > 2021-01-19 20:59:56 43 42 49 8c 00 00 36 00 00 01 01 02 04 01 00 0a |CBI...6.........| > 2021-01-19 20:59:56 00 06 04 03 0c 03 00 03 19 4d 54 35 33 45 35 31 |.........MT53E51| > 2021-01-19 20:59:56 32 4d 36 34 44 34 4e 57 2d 30 34 36 20 57 54 3a |2M64D4NW-046 WT:| > 2021-01-19 20:59:56 45 00 09 02 d2 04 ff ff ff ff ff 7f ff ff ff ff |E...............| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2020-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > > Change-Id: Ic8163ceaec55c429c9836f9a1e75d0de31ea072b > Signed-off-by: Thejaswani Puta <thejaswani.putta@intel.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2641127 > Reviewed-by: Keith Short <keithshort@chromium.org> > Commit-Queue: Thejaswani Putta <thejaswani.putta@intel.corp-partner.google.com> > Tested-by: Thejaswani Putta <thejaswani.putta@intel.corp-partner.google.com> Change-Id: Ifc4625446018b5a2d666205b2c9c649e75cdc138 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2684078 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Peter Marheine <pmarheine@chromium.org> Tested-by: Peter Marheine <pmarheine@chromium.org>
* CBI: Add rework_id fieldThejaswani Puta thejaswani.putta@intel.com2021-02-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This field will be used to describe all the reworks performed on a board which includes the mandatory, optional and feature reworks. Also modified existing command handlers under ectool and cbi-util tool to support 64 bit length data. BUG: b:170385859 TEST: ./cbi-util create --file ~/cbi_image --board_version 1 --oem_id 2 --sku_id 255 --dram_part_num "01654329efghac" --model_id 15 --rework_id 123456789123456712 --size 256 CBI image is created successfully TEST: ./cbi-util show --file ~/cbi_image CBI image: /home/thejaswani/cbi_image TOTAL_SIZE: 47 Data Field: name: value (hex, tag, size) BOARD_VERSION: 1 (0x1, 0, 1) OEM_ID: 2 (0x2, 1, 1) SKU_ID: 255 (0xff, 2, 1) MODEL_ID: 15 (0xf, 5, 1) REWORK_ID: 123456789123456712 (0x1b69b4bacd05ec8, 9, 8) DRAM_PART_NUM: 01654329efghac (3, 15) Data validated successfully TEST: hexdump -C ~/cbi_image 00000000 43 42 49 1e 00 00 2f 00 00 01 01 01 01 02 02 01 |CBI.../.........| 00000010 ff 05 01 0f 09 08 c8 5e d0 ac 4b 9b b6 01 03 0f |.......^..K.....| 00000020 30 31 36 35 34 33 32 39 65 66 67 68 61 63 00 ff |01654329efghac..| 00000030 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| * 00000100 TEST: localhost ~ # ectool cbi set 9 98765432 8 localhost ~ # ectool cbi get 9 As uint: 98765432 (0x5e30a78) As binary: 78 0a e3 05 00 00 00 00 localhost ~ # ectool cbi set 9 123456789123456712 8 localhost ~ # ectool cbi get 9 As uint: 123456789123456712 (0x1b69b4bacd05ec8) As binary: c8 5e d0 ac 4b 9b b6 01 localhost ~ # ectool cbi set 9 1234 2 localhost ~ # ectool cbi get 9 As uint: 1234 (0x4d2) As binary: d2 04 TEST: > cbi(from EC Console) 2021-01-19 20:59:56 [80.979692 CBI Reading board info] 2021-01-19 20:59:56 CBI_VERSION: 0x0000 2021-01-19 20:59:56 TOTAL_SIZE: 54 2021-01-19 20:59:56 BOARD_VERSION: 1 (0x1) 2021-01-19 20:59:56 OEM_ID: (Error 1) 2021-01-19 20:59:56 MODEL_ID: (Error 1) 2021-01-19 20:59:56 SKU_ID: 655361 (0xa0001) 2021-01-19 20:59:56 FW_CONFIG: 199683 (0x30c03) 2021-01-19 20:59:56 PCB_SUPPLIER: (Error 1) 2021-01-19 20:59:56 SSFC: (Error 1) 2021-01-19 20:59:56 REWORK_ID: 1234 (0x4d2) 2021-01-19 20:59:56 43 42 49 8c 00 00 36 00 00 01 01 02 04 01 00 0a |CBI...6.........| 2021-01-19 20:59:56 00 06 04 03 0c 03 00 03 19 4d 54 35 33 45 35 31 |.........MT53E51| 2021-01-19 20:59:56 32 4d 36 34 44 34 4e 57 2d 30 34 36 20 57 54 3a |2M64D4NW-046 WT:| 2021-01-19 20:59:56 45 00 09 02 d2 04 ff ff ff ff ff 7f ff ff ff ff |E...............| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2020-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 2021-01-19 20:59:56 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| Change-Id: Ic8163ceaec55c429c9836f9a1e75d0de31ea072b Signed-off-by: Thejaswani Puta <thejaswani.putta@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2641127 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Thejaswani Putta <thejaswani.putta@intel.corp-partner.google.com> Tested-by: Thejaswani Putta <thejaswani.putta@intel.corp-partner.google.com>
* cbi: add Second Source Factory Cache (SSFC) CBI fieldMarco Chen2020-08-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSFC field will be leveraged to record what second source is used in the DUT by probing components in the factory or RMA. Firmware code should refer to this field to judge what driver should be configured for a specific component. For example, the board code can arrange what sensor driver should be set into motion_sensors array if there are multiple sources of base or lid sensor. As the definition of FW_CONFIG, it describe which "features" the firmware code should enable or disable. For example, whether lid / base sensors should be enabled or not but not care about what second source is in this DUT. BRANCH=none BUG=b:163285687 TEST=call `cbi-util` to create the cbi image with SSFC and show created content. TEST=`make buildall -j` TEST=`make runhosttests -j` Change-Id: Icb4aa00ae47ab025198e7fd5edd6aab96a4bf53e Signed-off-by: Marco Chen <marcochen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2344268 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* CBI: Add unit testDaisuke Nojiri2020-08-071-0/+9
| | | | | | | | | | | | This patch adds unit tests for Cros Board Info APIs. BUG=b:163038871 BRANCH=none TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I7b2fdb2c4f13da12f8c0dc2ab526332cbd46d849 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2339393
* cbi: Support PCB supplier fieldAbe Levkoy2020-03-241-0/+1
| | | | | | | | | | | | | | | | | | | Add support for PCB_SUPPLIER, to distinguish boards of the same type with different PCB suppliers. BUG=b:140244489 TEST=ectool cbi set 7 0 1 0; ectool cbi get 7 TEST=cbi on EC console after writing with ectool TEST=/usr/share/userfeedback/scripts/cbi_info after writing with ectool TEST=cbi-util create --pcb_supplier 1 ...; cbi-util show ... BRANCH=none Change-Id: Ieadba91694f4775cc86c2c4b09cdf0874b9ad444 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108710 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: George Engelbrecht <engeg@google.com> Commit-Queue: George Engelbrecht <engeg@google.com>
* cbi: add FW_CONFIG CBI fieldJett Rink2019-12-161-1/+2
| | | | | | | | | | | | | | | | | | This field will be used to describe which "features" or path the firmware code should enable or disable. Firmware code should look at the firmware configuration value to make code decision for un-discoverable hardware connections or layouts that differ within the same firmware binary. Firmware should no longer use SKU_ID/VARIANT_ID to make decisions, only this new FW_CONFIG field. BRANCH=none BUG=b:145519081 TEST=Created cbi image with FW_CONFIG field Change-Id: I1db8e7638a15343173ea5061e9038a7d53bda090 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1945821 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* CBI: Allow board to compose data from other sourcesDaisuke Nojiri2019-04-191-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the source of CBI data is only EEPROM. This patch allows CBI data to be composed from other sources such as ADC or some chip register. cbi_board_override is called by CBI library when data is being requested. Boards can implement this callback to add additional bits or bytes to the data. A board itself may need to get CBI data first to manipulate data properly. For such a case, a board can return EC_ERROR_BUSY to inform the callers that the data is not fully ready while a board itself can accept EC_ERROR_BUSY as an expected value. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/129569858 BRANCH=none TEST=Read LCM_ID properly Change-Id: Ie1f962c64c8d1461a6c171bc6c6d0c855c82e945 Reviewed-on: https://chromium-review.googlesource.com/1572439 Commit-Ready: YH Lin <yueherngl@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* cbi: Add a new API for cbi_set_stringFurquan Shaikh2019-03-081-0/+16
| | | | | | | | | | | | | | | | | | | | This change introduces cbi_set_string that can be used by callers to add string data to CBI. Internally, this function ensures that the data is not NULL and call cbi_set_data for the string with a size of strlen + 1. It is added so that callers don't have to repeat the same operations for string data. BUG=b:124282048 BRANCH=None TEST=None Change-Id: Iad9da206c5e87735eac3adee6fce151fd1f0a53a Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1506440 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* CBI: Add MODEL_ID fieldDaisuke Nojiri2018-11-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MODEL_ID is an optional field containing a numeric value identifying models. Model IDs are unique within each OEM and <OEM_ID, MODEL_ID> should form a unique ID within the family. $ cbi-util create --file ~/cbi_image --board_version 0 --oem_id 6 --sku_id 255 --dram_part_num "012345679abcdef" --model_id 127 --size 256 $ hexdump -C /tmp/cbi.bin 0000 43 42 49 fa 00 00 26 00 00 01 00 01 01 06 02 01 |CBI...&.........| 0010 ff 05 01 7f 03 10 30 31 32 33 34 35 36 37 39 61 |......012345679a| 0020 62 63 64 65 66 00 ff ff ff ff ff ff ff ff ff ff |bcdef...........| $ cbi-util show --file /tmp/cbi.bin CBI image: /tmp/cbi.bin TOTAL_SIZE: 38 Data Field: name: value (hex, tag, size) BOARD_VERSION: 0 (0x0, 0, 1) OEM_ID: 6 (0x6, 1, 1) SKU_ID: 255 (0xff, 2, 1) MODEL_ID: 127 (0x7f, 5, 1) DRAM_PART_NUM: 012345679abcdef (3, 16) Data validated successfully localhost # ectool cbi set 5 127 1 localhost # ectool cbi get 5 As integer: 127 (0x7f) As binary: 7f > cbi [1289.860454 CBI Reading board info] CBI_VERSION: 0x0000 TOTAL_SIZE: 22 BOARD_VERSION: 513 (0x201) OEM_ID: 3 (0x3) MODEL_ID: 127 (0x7f) SKU_ID: 14951 (0x3a67) 43 42 49 b0 00 00 16 00 00 02 01 02 01 01 03 02 02 67 3a 05 01 7f ff ff ff ff ff ff ff ff ff ff Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:119522898,b:120105950 BRANCH=none TEST=See above. Change-Id: Ifd6f3087f5422bcf4c36d3d981b262653d0c89dc Reviewed-on: https://chromium-review.googlesource.com/1341099 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* cbi-util: Allow field size to be specifiedDaisuke Nojiri2018-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, field sizes are automatically set to the smallest size which can fit a given value. This patch makes cbi-util allow field sizes to be specified. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b:79514391 BRANCH=none TEST=Tested as follows: 1. Create CBI image: $ cbi-util create --file cbi.bin --board_version 0x202 \ --oem_id 0xabcd:2 --sku_id 0xff:4 --size 256 2. Verify the image: $ cbi-util show --file cbi.bin CBI image: /home/dnojiri/tmp/nami/tmp/cbi.new.bin TOTAL_SIZE: 22 Data Field: name: value (hex, tag, size) BOARD_VERSION: 514 (0x202, 0, 2) OEM_ID: 43981 (0xabcd, 1, 2) SKU_ID: 255 (0xff, 2, 4) 3. Verify the output matches with the previous output if field sizes are not specified. Change-Id: Ic7149274d6e4a118ea12bbf03199b548b7089a3e Reviewed-on: https://chromium-review.googlesource.com/1056201 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* CBI: Share common code between host tool and firmwareDaisuke Nojiri2018-02-231-0/+35
| | | | | | | | | | | | | | This patch makes EC firmware and cbi-util share the common code. BUG=b:70294260 BRANCH=none TEST=Set fields using ectool. Verify the contents by cbi command. Verify cbi-util creates the same binary as before. Verify emerge ec-utils ec-devutils pass. Change-Id: If5e65e48dd03960e0adf23ef775f67aecf785d85 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/932001
* CBI: Make data offset and size variableDaisuke Nojiri2018-02-161-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently CBI data offset and size are fixed. This patch makes them variable. Each data item consists of <tag><size><value> where <tag> is a numeric value assigned to each data item, <size> is the number of bytes used for <value>. BUG=b:70294260 BRANCH=none TEST=Use 'ectool cbi set' to set board version, oem, sku. Verify the contents by cbi console command and ectool cbi get. 1. ectool cbi set 0 0x202 2 2 (Init CBI and write board ver. of size 2) 2. ectool cbi set 1 1 1 (write oem id of size 1) 3. ectool cbi set 2 2 1 (write sku id of size 1) 4. ectool cbi get 0 514 (0x202) 5. ectool cbi get 1 1 (0x1) 6. ectool cbi get 2 2 (0x2) 7. Run cbi console command: CBI_VERSION: 0x0000 TOTAL_SIZE: 18 BOARD_VERSION: 514 (0x202) OEM_ID: 1 (0x1) SKU_ID: 2 (0x2) 43 42 49 8c 00 00 12 00 00 02 02 02 01 01 01 02 01 02 Change-Id: I5a30a4076e3eb448f4808d2af8ec4ef4c016ae5e Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/920905 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* CBI: Read board info from EEPROMDaisuke Nojiri2018-01-181-0/+60
This patch adds Cros Board Info APIs. It reads board info from EEPROM. This patch sets CONFIG_CBI for Fizz to make it use CBI. BUG=b:70294260 BRANCH=none TEST=Read data from EEPROM. Change-Id: I7eb4323188817d46b0450f1d65ac34d1b7e4e220 Reviewed-on: https://chromium-review.googlesource.com/707741 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>