下面的步骤其实在第(2)和第(3)节已经写过了,这里重新梳理一遍。
====> Step 1: <====
复制相近的dts文件,这样就不需要重新编写所有的内容,而是根据硬件修改相应变动的部分。
cd arch/arm/boot/dts
cp am335x-bone.dts maria-am335x.dts
cp am335x-bone-common.dtsi maria-am335x-common.dtsi
====> Step 2: <====
修改maria-am335x.dts中的model和compatible,删除掉不需要的vmmc-supply部分,因为我们的SD卡由底板供电,和核心板上的PMIC没有关系。
diff a/arch/arm/boot/dts/maria-am335x.dts b/arch/arm/boot/dts/maria-am335x.dts
--- a/arch/arm/boot/dts/maria-am335x.dts
+++ a/arch/arm/boot/dts/maria-am335x.dts
@@ -11,6 +11,6 @@
- #include am335x-evm-common.dtsi
-
- / {
- model = "TI AM335x BeagleBone";
- compatible = "ti,am335x-bone", "ti,am33xx";
- };
+ #include "maria-am335x-common.dtsi"
+
+ / {
+ model = "TI AM335x maria-am335x";
+ compatible = "ti,maria-am335x", "ti,am33xx";
+ };
@@ -24,4 +24,0 @@
- &mmc1 {
- vmmc-supply = <&ldo3_reg>;
- };
-
====> Step 3: <====
修改maria-am335x-common.dts文件,主要修改memory的值,从默认的256M改为1G。
OK335xD的配置是,SDRAM为1G,NANDFLASH为512M。
diff a/arch/arm/boot/dts/maria-am335x-common.dts b/arch/arm/boot/dts/maria-am335x-common.dts
--- a/arch/arm/boot/dts/maria-am335x-common.dts
+++ a/arch/arm/boot/dts/maria-am335x-common.dts
@@ -18,1 +18,1 @@
memory {
device_type = "memory";
- reg = <0x80000000 0x10000000>; /* 256 MB */
+ reg = <0x80000000 0x40000000>; /* 1 GB */
};
====> Step 4: <====
重新编译dtb文件以及内核,将它们放置在tftp服务器目录下。
make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -j8 am335x-bone.dtb
make ARCH=arm CROSS_COMPILE=/opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -j8 LOADADDR=0x80008000 uImage
cp arch/arm/boot/dts/maria-am335x.dtb arch/arm/boot/uImage /tftp_root/
====> Step 5: <====
从SD卡启动U-Boot,在其命令行使用tftp获取dtb文件和uImage,放置在SDRAM中,并从SDRAM启动。
(也可以放置在SD卡或者NANDFLASH,然后重新上电,但是直接放置在SDRAM中更加方便。)
U-Boot# set ipaddr 192.168.1.117; set serverip 192.168.1.116
U-Boot# tftp 0x83000000 maria-am335x.dtb
U-Boot# tftp 0x82000000 uImage
U-Boot# bootm 0x82000000 - 0x83000000
此时就可以看到熟悉的Kernel解压打印信息了,制作自己的dtb文件其实非常简单哦!
下一节,从简单的GPIO开始。
DiracFatCat 2015-2-11 09:09
用户1711475 2015-2-10 10:22