Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle board-revision detection #2

Open
Juul opened this issue May 16, 2019 · 1 comment
Open

Handle board-revision detection #2

Juul opened this issue May 16, 2019 · 1 comment
Assignees

Comments

@Juul
Copy link
Member

Juul commented May 16, 2019

Each kindle model has been produced in different revisions.

These are specified at the top of /include/asm-arm/arch-mx50/mx50_yoshi_board.h in the boards[] array:

static const struct board_type boards[] = ...

Each revision specifies board ID, name, RAM type and RAM quantity. When u-boot loads, in order to initialize the RAM, it reads from the nvram_info[] array from the same file which specifies a name, offset and size for each of a set of variables. One of these variables is called pcbsn.

The variable pcbsn is read by setup_board_info() in board/imx50_yoshi/imx50_yoshi.c which calls setup_board_info() which actually calls idme_get_var() in common/cmd_idme.c.

idme_get_var() then reads from the userdata partition which is hardcoded in u-boot using the address in CONFIG_MMC_USERDATA_ADDR. It reads at the offset specified in nvram_info[] for the pcbsn variable.

The value of pcbsn is saved in the board_id C variable (again by setup_board_info()) and then matched against the board id from the boards[] array by the function get_board_type() in the same imx50_yoshi.c file.

@Juul Juul self-assigned this May 16, 2019
@Juul
Copy link
Member Author

Juul commented May 16, 2019

We need to save this "userdata" partition data somewhere so it can still be read. One option is to leave it where it currently is for now, which is from 252 kB to 257 kB on the flash memory which doesn't waste that much storage and saves time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant