3 * Stefan Roese, DENX Software Engineering, sr@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
12 static u8 boot_267_nor[] = {
13 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x00,
14 0x14, 0xc0, 0x36, 0xcc, 0x00, 0x0c, 0x00, 0x00,
15 0x00, 0x00, 0x00, 0x00
18 static u8 boot_267_nand[] = {
19 0xd0, 0x38, 0xc3, 0x50, 0x13, 0x88, 0x8e, 0x00,
20 0x14, 0xc0, 0x36, 0xcc, 0x00, 0x0c, 0x00, 0x00,
21 0x00, 0x00, 0x00, 0x00
24 static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
31 return cmd_usage(cmdtp);
33 cpu_freq = simple_strtol(argv[1], NULL, 10);
34 if (cpu_freq != 267) {
35 printf("Unsupported cpu-frequency - only 267 supported\n");
39 /* use 0x50 as I2C EEPROM address for now */
42 if ((strcmp(argv[2], "nor") != 0) &&
43 (strcmp(argv[2], "nand") != 0)) {
44 printf("Unsupported boot-device - only nor|nand support\n");
48 if (strcmp(argv[2], "nand") == 0) {
66 if (i2c_write(chip, 0, 1, buf, 16) != 0)
67 printf("Error writing to EEPROM at address 0x%x\n", chip);
68 udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
69 if (i2c_write(chip, 0x10, 1, buf+16, 4) != 0)
70 printf("Error2 writing to EEPROM at address 0x%x\n", chip);
73 printf("Please power-cycle the board for the changes to take effect\n");
79 bootstrap, 3, 0, do_bootstrap,
80 "program the I2C bootstrap EEPROM",
81 "<cpu-freq> <nor|nand> - program the I2C bootstrap EEPROM"