Merge pull request #1 from puhitaku/lilo

Make it bootable from EBOOT
This commit is contained in:
Takumi Sueda 2020-10-12 06:15:02 +09:00 committed by GitHub
commit 2270e04c3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 57 deletions

View File

@ -177,7 +177,8 @@ const char *get_imx_type(u32 imxtype)
int print_cpuinfo(void) int print_cpuinfo(void)
{ {
u32 cpurev; u32 cpurev;
struct mxs_spl_data *data = MXS_SPL_DATA; uint8_t bootmode = 0, masked;
int i;
cpurev = get_cpu_rev(); cpurev = get_cpu_rev();
printf("CPU: Freescale i.MX%s rev%d.%d at %d MHz\n", printf("CPU: Freescale i.MX%s rev%d.%d at %d MHz\n",
@ -185,7 +186,17 @@ int print_cpuinfo(void)
(cpurev & 0x000F0) >> 4, (cpurev & 0x000F0) >> 4,
(cpurev & 0x0000F) >> 0, (cpurev & 0x0000F) >> 0,
mxc_get_clock(MXC_ARM_CLK) / 1000000); mxc_get_clock(MXC_ARM_CLK) / 1000000);
printf("BOOT: %s\n", mxs_boot_modes[data->boot_mode_idx].mode);
#define GLOBAL_BOOT_MODE_ADDR 0x00019BF0
bootmode = __raw_readl(GLOBAL_BOOT_MODE_ADDR);
for (i = 0; i < ARRAY_SIZE(mxs_boot_modes); i++) {
masked = bootmode & mxs_boot_modes[i].boot_mask;
if (masked == mxs_boot_modes[i].boot_pads)
break;
}
printf("BOOT: %s\n", mxs_boot_modes[i].mode);
return 0; return 0;
} }
#endif #endif

View File

@ -4,6 +4,6 @@ SECTION 0x0 BOOTABLE
LOAD 0x1000 spl/u-boot-spl.bin LOAD 0x1000 spl/u-boot-spl.bin
LOAD IVT 0x8000 0x1000 LOAD IVT 0x8000 0x1000
CALL HAB 0x8000 0x0 CALL HAB 0x8000 0x0
LOAD 0x40002000 u-boot.bin LOAD 0x40200000 u-boot.bin
LOAD IVT 0x8000 0x40002000 LOAD IVT 0x8000 0x40200000
CALL HAB 0x8000 0x0 CALL HAB 0x8000 0x0

View File

@ -20,54 +20,54 @@ __weak uint32_t mxs_dram_vals[] = {
* i.MX28 DDR2 at 200MHz * i.MX28 DDR2 at 200MHz
*/ */
#if defined(CONFIG_MX28) #if defined(CONFIG_MX28)
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 000 - 003
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 004 - 007
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 008 - 011
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 012 - 015
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 016 - 019
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 020 - 023
0x00000000, 0x00000000, 0x00010101, 0x01010101, 0x00000000, 0x00000000, 0x00010101, 0x01010101, // 024 - 027
0x000f0f01, 0x0f02010a, 0x00000000, 0x00000101, 0x000f0f01, 0x0f02010a, 0x00000000, 0x00000101, // 028 - 031
0x00000100, 0x00000100, 0x01000000, 0x00000002, 0x00000100, 0x00000100, 0x01000000, 0x00000002, // 032 - 035
0x01010000, 0x08060301, 0x06000001, 0x0a000000, 0x01010000, 0x06040201, 0x06000001, 0x0a000000, // 036 - 039
0x02009c40, 0x0002030b, 0x0036a608, 0x03160305, 0x02009c40, 0x0002030b, 0x0036b008, 0x030e0550, // 040 - 043
0x03030002, 0x001f001c, 0x00000000, 0x00000000, 0x02030002, 0x00170017, 0x00000000, 0x00000000, // 044 - 047
0x00012100, 0xffff0303, 0x00012100, 0xffff0303, 0x00013200, 0xffff0303, 0x00013200, 0xffff0303, // 048 - 051
0x00012100, 0xffff0303, 0x00012100, 0xffff0303, 0x00013200, 0xffff0303, 0x00013200, 0xffff0303, // 052 - 055
0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000000, // 056 - 059
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 060 - 063
0x00000000, 0x00000000, 0x00000305, 0x01000f02, 0x00000000, 0x00000000, 0x00000305, 0x01000f02, // 064 - 067
0x00000000, 0x00000200, 0x00020007, 0xf3004a27, 0x00000000, 0x00000200, 0x00020007, 0xf3004a27, // 068 - 071
0xf3004a27, 0x00000000, 0x00000000, 0x07000310, 0xf3004a27, 0x00000000, 0x00000000, 0x07000310, // 072 - 075
0x07000310, 0x00000000, 0x00000000, 0x00800004, 0x07000310, 0x00000000, 0x00000000, 0x00800004, // 076 - 079
0x00000000, 0x00000000, 0x01000000, 0x01020408, 0x00000000, 0x00000000, 0x01000000, 0x01020408, // 080 - 083
0x08040201, 0x000f1133, 0x00000000, 0x00001f08, 0x08040201, 0x000f1133, 0x00000000, 0x00001f08, // 084 - 087
0x00001f08, 0x00000000, 0x00000000, 0x00001f01, 0x00001f08, 0x00000000, 0x00000000, 0x00001f01, // 088 - 091
0x00001f01, 0x00000000, 0x00000000, 0x00000000, 0x00001f01, 0x00000000, 0x00000000, 0x00000000, // 092 - 095
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 096 - 099
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 100 - 103
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 104 - 107
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 108 - 111
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 112 - 115
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 116 - 119
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 120 - 123
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 124 - 127
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 128 - 131
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 132 - 135
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 136 - 139
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 140 - 143
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 144 - 147
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 148 - 151
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 152 - 155
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 156 - 159
0x00000000, 0x00000000, 0x00000000, 0x00010301, 0x00000000, 0x00000000, 0x00000000, 0x00010301, // 160 - 163
0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, // 164 - 167
0x00000000, 0x00000000, 0x00000000, 0x01010000, 0x00000000, 0x00000000, 0x00000000, 0x01010000, // 168 - 171
0x01000100, 0x03030000, 0x00020303, 0x01010202, 0x01000100, 0x03030000, 0x00020303, 0x01010202, // 172 - 175
0x00000000, 0x01030101, 0x21002101, 0x00030500, 0x00000000, 0x01030101, 0x21002101, 0x00030500, // 176 - 179
0x03050305, 0x00320032, 0x00320032, 0x00000000, 0x03050305, 0x00320032, 0x00320032, 0x00000000, // 180 - 183
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // 184 - 187
0x00000000, 0xffffffff 0x00000000, 0xffffffff // 188 - 189
/* /*
* i.MX23 DDR at 133MHz * i.MX23 DDR at 133MHz

View File

@ -52,7 +52,8 @@ int board_early_init_f(void)
int dram_init(void) int dram_init(void)
{ {
return mxs_dram_init(); gd->ram_size = 0x8000000; // 128MiB
return 0;
} }
int board_init(void) int board_init(void)

View File

@ -1,6 +1,6 @@
CONFIG_ARM=y CONFIG_ARM=y
CONFIG_ARCH_MX28=y CONFIG_ARCH_MX28=y
CONFIG_SYS_TEXT_BASE=0x40002000 CONFIG_SYS_TEXT_BASE=0x40200000
CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_GPIO_SUPPORT=y
CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y
@ -9,7 +9,6 @@ CONFIG_SPL_SERIAL_SUPPORT=y
CONFIG_SPL=y CONFIG_SPL=y
CONFIG_NR_DRAM_BANKS=1 CONFIG_NR_DRAM_BANKS=1
CONFIG_FIT=y CONFIG_FIT=y
# CONFIG_CONSOLE_MUX is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_VERSION_VARIABLE=y CONFIG_VERSION_VARIABLE=y
# CONFIG_DISPLAY_BOARDINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set
@ -22,7 +21,6 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y CONFIG_CMD_MMC=y
CONFIG_CMD_SF=y CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y CONFIG_CMD_SPI=y
CONFIG_CMD_BMP=y
CONFIG_CMD_CACHE=y CONFIG_CMD_CACHE=y
CONFIG_CMD_DATE=y CONFIG_CMD_DATE=y
CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4=y
@ -37,5 +35,4 @@ CONFIG_SPI_FLASH_SST=y
CONFIG_CONS_INDEX=0 CONFIG_CONS_INDEX=0
CONFIG_SPI=y CONFIG_SPI=y
CONFIG_MXS_SPI=y CONFIG_MXS_SPI=y
CONFIG_VIDEO=y
CONFIG_OF_LIBFDT=y CONFIG_OF_LIBFDT=y