]>
Commit | Line | Data |
---|---|---|
5fb692ca SR |
1 | /* |
2 | * (C) Copyright 2007 | |
3 | * Stefan Roese, DENX Software Engineering, sr@denx.de. | |
4 | * | |
1a459660 | 5 | * SPDX-License-Identifier: GPL-2.0+ |
5fb692ca SR |
6 | */ |
7 | ||
8 | #include <config.h> | |
9 | #include <common.h> | |
10 | #include <command.h> | |
11 | #include <asm/processor.h> | |
12 | #include <i2c.h> | |
13 | ||
14 | #if defined(CONFIG_TAISHAN) | |
15 | ||
16 | const uchar bootstrap_buf[16] = { | |
17 | 0x86, | |
18 | 0x78, | |
19 | 0xc1, | |
20 | 0xa6, | |
21 | 0x09, | |
22 | 0x67, | |
23 | 0x04, | |
24 | 0x63, | |
25 | 0x00, | |
26 | 0x00, | |
27 | 0x00, | |
28 | 0x00, | |
29 | 0x00, | |
30 | 0x00, | |
31 | 0x00, | |
32 | 0x00 | |
33 | }; | |
34 | ||
35 | static int update_boot_eeprom(void) | |
36 | { | |
37 | ulong len = 0x10; | |
6d0f6bcf | 38 | uchar chip = CONFIG_SYS_BOOTSTRAP_IIC_ADDR; |
5fb692ca SR |
39 | uchar *pbuf = (uchar *)bootstrap_buf; |
40 | int ii, jj; | |
41 | ||
42 | for (ii = 0; ii < len; ii++) { | |
43 | if (i2c_write(chip, ii, 1, &pbuf[ii], 1) != 0) { | |
44 | printf("i2c_write failed\n"); | |
45 | return -1; | |
46 | } | |
47 | ||
48 | /* wait 10ms */ | |
49 | for (jj = 0; jj < 10; jj++) | |
50 | udelay(1000); | |
51 | } | |
52 | return 0; | |
53 | } | |
54 | ||
54841ab5 | 55 | int do_update_boot_eeprom(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
5fb692ca SR |
56 | { |
57 | return update_boot_eeprom(); | |
58 | } | |
59 | ||
60 | U_BOOT_CMD(update_boot_eeprom, 1, 1, do_update_boot_eeprom, | |
a89c33db | 61 | "update bootstrap eeprom content", ""); |
5fb692ca | 62 | #endif |