build
make O=../u-boot-am4372 am43xx_evm_defconfig
make O=../u-boot-am4372
Use Fdisk to flash rootfs/MLO/u-boot.img to emmc
setup nfs boot,copy zImage,dtb to ~/tftpboot
=>setenv serverip 192.168.1.105
=>run findfdt
=>setenv rootpath /home/th/nfs/rootfs
=>run netboot
part and format emmc
after nfsboot
-
Assuming the eMMC is /dev/mmcblk0. Format it this way:
1.01. fdisk /dev/mmcblk0
1.02. o - this clears the existing partitions
1.03. p - this lists all partition tables on the card (there should be none)
1.04. n - create a new partition
1.05. p - primary partition
1.06. 1 - partition number
1.07. 2048 - default value for the first sector
1.08. +16M - last sector / partition size
1.09. t - change the partition type (select partition 1)
1.10. e - change tha partition type to "W95 FAT16 (LBA)"
1.11. a - set the bootable flag for the selected partition (select partition 1)
1.12. n - create a new partition
1.13. p - primary partition
1.14. 2 - partition number
1.15. hit Enter to choose the default (next available) value for the first sector
1.16. hit Enter to choose the default (last) value for the last sector
1.17. p - this lists all partition tables on the card (there should be two)
1.18. w - write all the above changes to disk
1.19. umount /dev/mmcblk0p1 - if mounted
1.20. mkfs.vfat -F 16 /dev/mmcblk0p1 - format the first partition
1.21. umount /dev/mmcblk0p2 - if mounted
1.22. mkfs.ext4 /dev/mmcblk0p2 - format the second partition -
Copy the {MLO,u-boot.img,uImage} files to the first partition:
2.1. mkdir boot
2.2. mount /dev/mmcblk0p1 boot
2.3. cp /{MLO,u-boot.img,uImage} boot
2.4. sync
2.5. umount boot -
Extract the root file system to the second partition:
3.1. mkdir root
3.2. mount /dev/mmcblk0p2 root
3.3. tar -xf /tisdk-rootfs-image-am335x-evm.tar.gz -C root
3.4. sync
3.5. umount root
change points
From 9d79400f8720ceb912367d1768d82668e8ac2ca0 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Sun, 8 Mar 2020 23:10:14 +0800
Subject: [PATCH] add am4372 ds support
---
Makefile | 2 +-
arch/arm/dts/am437x-gp-evm-u-boot.dtsi | 4 ++++
arch/arm/dts/am437x-gp-evm.dts | 27 +++++++++++++++++++++++++--
board/ti/am43xx/board.c | 2 +-
board/ti/am43xx/mux.c | 15 ++++++++++++++-
board/ti/common/board_detect.c | 2 +-
include/configs/am43xx_evm.h | 6 +++++-
include/environment/ti/mmc.h | 2 +-
8 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 0af89e0..c21fc54 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ else ifeq ("riscv32", $(MK_ARCH))
else ifeq ("riscv64", $(MK_ARCH))
export HOST_ARCH=$(HOST_ARCH_RISCV64)
endif
-undefine MK_ARCH
+#undefine MK_ARCH
# Avoid funny character set dependencies
unexport LC_ALL
diff --git a/arch/arm/dts/am437x-gp-evm-u-boot.dtsi b/arch/arm/dts/am437x-gp-evm-u-boot.dtsi
index b55aa8e..e59b6e8 100644
--- a/arch/arm/dts/am437x-gp-evm-u-boot.dtsi
+++ b/arch/arm/dts/am437x-gp-evm-u-boot.dtsi
@@ -23,6 +23,10 @@
u-boot,dm-spl;
};
+&mmc2 {
+ u-boot,dm-spl;
+};
+
&mac {
u-boot,dm-spl;
};
diff --git a/arch/arm/dts/am437x-gp-evm.dts b/arch/arm/dts/am437x-gp-evm.dts
index 3c500d5..0b4a4aa 100644
--- a/arch/arm/dts/am437x-gp-evm.dts
+++ b/arch/arm/dts/am437x-gp-evm.dts
@@ -136,6 +136,20 @@
pinctrl-0 = <&wlan_pins_default>;
pinctrl-1 = <&wlan_pins_sleep>;
+ emmc_pins: emmc_pins {
+ pinctrl-single,pins = <
+ AM4372_IOPAD(0x820, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad8.mmc1_dat0 */
+ AM4372_IOPAD(0x824, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad9.mmc1_dat1 */
+ AM4372_IOPAD(0x828, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad10.mmc1_dat2 */
+ AM4372_IOPAD(0x82c, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad11.mmc1_dat3 */
+ AM4372_IOPAD(0x830, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad12.mmc1_dat4 */
+ AM4372_IOPAD(0x834, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad13.mmc1_dat5 */
+ AM4372_IOPAD(0x838, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad14.mmc1_dat6 */
+ AM4372_IOPAD(0x83c, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad15.mmc1_dat7 */
+ AM4372_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
+ AM4372_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
+ >;
+ };
i2c0_pins: i2c0_pins {
pinctrl-single,pins = <
0x188 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_sda.i2c0_sda */
@@ -576,6 +590,15 @@
cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
};
+&mmc2 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&emmc_pins>;
+ vmmc-supply = <&vmmcsd_fixed>;
+ bus-width = <8>;
+ ti,non-removable;
+};
+
&mmc3 {
/* disable MMC3 as SDIO is not supported in U-Boot */
status = "disabled";
@@ -646,8 +669,8 @@
pinctrl-1 = <&davinci_mdio_sleep>;
status = "okay";
- ethphy0: ethernet-phy@0 {
- reg = <0>;
+ ethphy0: ethernet-phy@4 {
+ reg = <4>;
};
};
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 21fc5ed..484c8c2 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -724,7 +724,7 @@ int board_late_init(void)
{
struct udevice *dev;
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
- set_board_info_env(NULL);
+ set_board_info_env("AM43__GP");
/*
* Default FIT boot on HS devices. Non FIT images are not allowed
diff --git a/board/ti/am43xx/mux.c b/board/ti/am43xx/mux.c
index f59e93a..cd4946a 100644
--- a/board/ti/am43xx/mux.c
+++ b/board/ti/am43xx/mux.c
@@ -103,7 +103,19 @@ static struct module_pin_mux nand_pin_mux[] = {
{-1},
};
#endif
-
+static struct module_pin_mux emmc_pin_mux[] = {
+ {OFFSET(gpmc_csn1), (MODE(2) | PULLUDDIS | RXACTIVE)}, /* EMMC_CLK */
+ {OFFSET(gpmc_csn2), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_CMD */
+ {OFFSET(gpmc_ad8), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_DAT0 */
+ {OFFSET(gpmc_ad9), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_DAT1 */
+ {OFFSET(gpmc_ad10), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_DAT2 */
+ {OFFSET(gpmc_ad11), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_DAT3 */
+ {OFFSET(gpmc_ad12), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_DAT4 */
+ {OFFSET(gpmc_ad13), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_DAT5 */
+ {OFFSET(gpmc_ad14), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_DAT6 */
+ {OFFSET(gpmc_ad15), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* EMMC_DAT7 */
+ {-1},
+};
static __maybe_unused struct module_pin_mux qspi_pin_mux[] = {
{OFFSET(gpmc_csn0), (MODE(3) | PULLUP_EN | RXACTIVE)}, /* QSPI_CS0 */
{OFFSET(gpmc_csn3), (MODE(2) | PULLUP_EN | RXACTIVE)}, /* QSPI_CLK */
@@ -126,6 +138,7 @@ void enable_board_pin_mux(void)
configure_module_pin_mux(mdio_pin_mux);
if (board_is_evm()) {
+ configure_module_pin_mux(emmc_pin_mux);
configure_module_pin_mux(gpio5_7_pin_mux);
configure_module_pin_mux(rgmii1_pin_mux);
#if defined(CONFIG_MTD_RAW_NAND)
diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c
index cbd35f2..90674ff 100644
--- a/board/ti/common/board_detect.c
+++ b/board/ti/common/board_detect.c
@@ -560,7 +560,7 @@ bool __maybe_unused board_ti_k3_is(char *name_tag)
bool __maybe_unused board_ti_is(char *name_tag)
{
struct ti_common_eeprom *ep = TI_EEPROM_DATA;
-
+ return !strncmp(name_tag, "AM43__GP", TI_EEPROM_HDR_NAME_LEN);
if (ep->header == TI_DEAD_EEPROM_MAGIC)
return false;
return !strncmp(ep->name, name_tag, TI_EEPROM_HDR_NAME_LEN);
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index 4a2c39c..cc8705c 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -8,6 +8,10 @@
#ifndef __CONFIG_AM43XX_EVM_H
#define __CONFIG_AM43XX_EVM_H
+#define CONFIG_HSMMC2_8BIT
+#define CONFIG_SUPPORT_EMMC_BOOT
+#define CONFIG_EMMC_BOOT
+
#define CONFIG_MAX_RAM_BANK_SIZE (1024 << 21) /* 2GB */
#define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
@@ -117,7 +121,7 @@
DEFAULT_MMC_TI_ARGS \
DEFAULT_FIT_TI_ARGS \
"fdtfile=undefined\0" \
- "bootpart=0:2\0" \
+ "bootpart=1:2\0" \
"bootdir=/boot\0" \
"bootfile=zImage\0" \
"console=ttyO0,115200n8\0" \
diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h
index 1c8e49a..d4af13e 100644
--- a/include/environment/ti/mmc.h
+++ b/include/environment/ti/mmc.h
@@ -9,7 +9,7 @@
#define __TI_MMC_H
#define DEFAULT_MMC_TI_ARGS \
- "mmcdev=0\0" \
+ "mmcdev=1\0" \
"mmcrootfstype=ext4 rootwait\0" \
"finduuid=part uuid mmc ${bootpart} uuid\0" \
"args_mmc=run finduuid;setenv bootargs console=${console} " \
--
1.9.1

本文档详细介绍了如何将U-Boot 2020.04-rc2-g464df88-dirty版本移植到am4372平台,包括构建过程、使用Fdisk将rootfs/MLO/u-boot.img刷写到emmc,设置NFS启动,格式化emmc分区,以及将所需文件复制到指定位置。
4891

被折叠的 条评论
为什么被折叠?



