网上的很多直接讲了乱七八糟的启动过程,我直接把git的改动目录copy下来了,大家可以看看,其实主要就是针对eeprom和sdram的
之前移植过,但是没有做笔记,现在重新移植一下,
安装乱七八糟的不说了,交叉编译放入环境变量搞好就可以。
环境变量位置:
ti-sdk-am335x-evm-08.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin
uboot版本:u-boot-2014.07-g7e537bf
linux版本:linux-3.14.26-g2489c02
拿来uboot习惯性先make一下,看有没有报错
cd ti-sdk-am335x-evm-08.00.00.00/board-support/u-boot-2014.07-g7e537bf# make distclean
make distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
共修改四个文件,主要是看ddr的大小,如果是256m和我一样改既可以。
如下四个文件
board/ti/am335x/board.c
board/ti/am335x/board.h
board/ti/am335x/mux.c
include/configs/ti_armv7_common.h
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -45,6 +45,13 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
*/
static int read_eeprom(struct am335x_baseboard_id *header)
{
+
+ header->magic = 0xEE3355AA;
+ strcpy(header->name, "WMZ335X");
+ strcpy(header->version, "V01");
+ strcpy(header->serial, "WMZ20190403");
+ strcpy(header->config, "LCD");
@@ -45,6 +45,13 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
*/
static int read_eeprom(struct am335x_baseboard_id *header)
{
+
+ header->magic = 0xEE3355AA;
+ strcpy(header->name, "WMZ335X");
+ strcpy(header->version, "V01");
+ strcpy(header->serial, "WMZ20190403");
+ strcpy(header->config, "LCD");
+ return 0;
/* Check if baseboard eeprom is available */
if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) {
puts("Could not probe the EEPROM; something fundamentally "
@@ -229,7 +236,7 @@ void am33xx_spl_board_init(void)
/* Get the frequency */
dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
- if (board_is_bone(&header) || board_is_bone_lt(&header)) {
+ if (board_is_bone(&header) || board_is_bone_lt(&header)||board_is_wmz(&header)) {
/* BeagleBone PMIC Code */
int usb_cur_lim;
@@ -263,7 +270,7 @@ void am33xx_spl_board_init(void)
* Override what we have detected since we know if we have
* a Beaglebone Black it supports 1GHz.
*/
- if (board_is_bone_lt(&header))
+ if (board_is_bone_lt(&header)||board_is_wmz(&header))
dpll_mpu_opp100.m = MPUPLL_M_1000;
/*
@@ -373,7 +380,7 @@ const struct dpll_params *get_dpll_ddr_params(void)
if (board_is_evm_sk(&header))
return &dpll_ddr_evm_sk;
- else if (board_is_bone_lt(&header))
+ else if (board_is_bone_lt(&header)||board_is_wmz(&header))
return &dpll_ddr_bone_black;
else if (board_is_evm_15_or_later(&header))
return &dpll_ddr_evm_sk;
@@ -464,7 +471,7 @@ void sdram_init(void)
if (board_is_evm_sk(&header))
config_ddr(303, &ioregs_evmsk, &ddr3_data,
&ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
- else if (board_is_bone_lt(&header))
+ else if (board_is_bone_lt(&header)||board_is_wmz(&header))
config_ddr(400, &ioregs_bonelt,
&ddr3_beagleblack_data,
&ddr3_beagleblack_cmd_ctrl_data,
@@ -622,7 +629,7 @@ int board_eth_init(bd_t *bis)
puts("Could not get board ID.\n");
if (board_is_bone(&header) || board_is_bone_lt(&header) ||
- board_is_idk(&header)) {
+ board_is_idk(&header)||board_is_wmz(&header)) {
writel(MII_MODE_ENABLE, &cdev->miisel);
cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
PHY_INTERFACE_MODE_MII;
diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h
index bc700d5..cb45f79 100755
--- a/board/ti/am335x/board.h
+++ b/board/ti/am335x/board.h
@@ -39,6 +39,11 @@ static inline int board_is_bone_lt(struct am335x_baseboard_id *header)
return !strncmp(header->name, "A335BNLT", HDR_NAME_LEN);
}
+static inline int board_is_wmz(struct am335x_baseboard_id *header)
+{
+ return !strncmp(header->name, "WMZ335X", HDR_NAME_LEN);
+}
+
static inline int board_is_evm_sk(struct am335x_baseboard_id *header)
{
return !strncmp("A335X_SK", header->name, HDR_NAME_LEN);
diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
index 54e8678..2c18339 100755
--- a/board/ti/am335x/mux.c
+++ b/board/ti/am335x/mux.c
@@ -359,7 +359,7 @@ void enable_board_pin_mux(struct am335x_baseboard_id *header)
configure_module_pin_mux(gpio0_7_pin_mux);
configure_module_pin_mux(rgmii1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux_sk_evm);
- } else if (board_is_bone_lt(header)) {
+ } else if (board_is_bone_lt(header)||board_is_wmz(header)) {
/* Beaglebone LT pinmux */
configure_module_pin_mux(i2c1_pin_mux);
configure_module_pin_mux(mii1_pin_mux);
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
index d692722..8c838dd 100755
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -200,7 +200,9 @@
!(defined(CONFIG_QSPI_BOOT) && defined(CONFIG_AM43XX))
#define CONFIG_SPL
#define CONFIG_SPL_FRAMEWORK
+#if defined(CONFIG_SPL_OS_BOOT_ENABLE)
#define CONFIG_SPL_OS_BOOT
+#endif