<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          Linux s3c6410 移植

          作者: 時(shí)間:2016-11-23 來源:網(wǎng)絡(luò) 收藏
          UBoot移植

          UBoot版本:u-boot-2010.03.tar.bz2
          ARCH: arm
          CPU: arm1176
          BOARD: samsung/smdk6410
          SOC: s3c64xx
          添加和裁剪源代碼
          添加相關(guān)文件夾和源代碼:
          1)創(chuàng)建文件夾:board/samsung/smdk6410; nand_spl/board/samsung/smdk6410。
          2)復(fù)制board/samsung/smdk6400/下所有文件到board/samsung/smdk6410。
          3)復(fù)制nand_spl/board/samsung/smdk6400下所有文件到nand_spl/board/samsung/smdk6410。
          4)復(fù)制include/configs/smdk6400.h為include/configs/smdk6410.h。
          去除不相關(guān)代碼:
          5)刪除board文件下除samsung外所有文件夾以及board/ samsung/下smdk6410外所有文件夾。
          6)刪除nand_spl/board下除samsung外所有文件夾以及nand_spl/board/samsung/smdk6410外所有文件夾。
          7)刪除include/configs/下除smdk6410.h以外其他所有文件。
          8)刪除頂層目錄下所有的lib_* 其他文件夾,只需要保留lib_arm 和 lib_generic。
          9)刪除cpu目錄下所有其他文件夾,只需要保留arm1176文件夾。
          10)刪除include下所有其他的asm_* 文件夾,只需要asm_arm和asm-generic,
          11)刪除include/arm-asm下arch-s3c64x0以外其他所有arch-*格式目錄。
          12)刪除根目錄下沒有用到的onenan_ipl文件夾。
          頂層Makefile修改
          仿照smdk6400 添加smdk6410的實(shí)現(xiàn)
          smdk6410_config : unconfig
          @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
          @echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/smdk6410/config.tmp
          @$(MKCONFIG) $(@:_config=) arm arm1176 smdk6410 samsung s3c64xx
          @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk

          本文引用地址:http://www.ex-cimer.com/article/201611/320473.htm

          修改boardsunplusdtvb7056下文件
          1)修改smdk6400.c為smdk6410.c,并修改boardsamsungsmdk6410Makefile中對應(yīng)的文件名。
          修改nand_spl/board/samsung/smdk6410 下文件
          1)修改Makefile文件中6400為6410:@ln -s $(TOPDIR)/board/samsung/smdk6410/lowlevel_init.S $@
          至此:可以測試是否可以編譯通過 make distclean&&make smdk6410_config&&make;

          修改smdk6410.h中相關(guān)設(shè)置

          //#define MACH_TYPE 1270 //smdk6400
          #define MACH_TYPE 1626 //smdk6410 這個(gè)type必須和kernel的一致

          #if 0
          #define CONFIG_NET_MULTI
          #define CONFIG_CS8900
          #define CONFIG_CS8900_BASE 0x18800300
          #define CONFIG_CS8900_BUS16
          #else
          #define CONFIG_NET_MULTI
          #define CONFIG_DRIVER_DM9000
          #define CONFIG_DM9000_BASE 0x18000300
          #define DM9000_IO CONFIG_DM9000_BASE
          #define DM9000_DATA ( CONFIG_DM9000_BASE + 4 )
          #endif

          ……

          #define CONFIG_BOOTDELAY 3
          #define CONFIG_ETHADDR 00:40:5c:26:0a:51
          #define CONFIG_NETMASK 255.255.252.0
          #define CONFIG_IPADDR 172.20.21.111
          #define CONFIG_SERVERIP 172.20.9.11
          #define CONFIG_GATEWAYIP 172.20.23.254
          #define CONFIG_HOSTNAME "divser1"
          #define CONFIG_BOOTFILE "uImage"
          #define CONFIG_BOOTARGS
          "console=ttySAC0,115200 "
          "root=/dev/nfs rw nfsroot=172.20.9.11:/home/junxian/rootfs "
          "ip=172.20.21.110:172.20.9.11:172.20.23.254:255.255.252.0:"
          "hoxm:eth0:none"
          #ifdef CONFIG_ENABLE_MMU
          #define CONFIG_BOOTCOMMAND "nand read 0xc0018000 0x60000 0x1c0000;"
          "bootm 0xc0018000"
          #else
          #define CONFIG_BOOTCOMMAND "nand read 0x50018000 0x60000 0x1c0000;"
          "bootm 0x50018000"
          #endif

          添加Uboot DM9000網(wǎng)卡驅(qū)動
          #ifdef CONFIG_CMD_NET
          int board_eth_init(bd_t *bis)
          {
          int rc = 0;
          126 #ifdef CONFIG_CS8900
          rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
          128 #endif
          #ifdef CONFIG_DRIVER_DM9000
          dm9000_initialize(bis);
          #endif
          return rc;
          }
          #endif

          現(xiàn)在ping,tftp,等等命令已經(jīng)好用,中間遇到的問題,有待研究:
          1)ping命令可以,tftp命令停在loading #, 發(fā)現(xiàn)修改smdk6410 config時(shí)候?qū)懭氲腞AM_TEXT地址為MMU地址即好用RAM_TEXT = 0xc7e00000,只是編譯的時(shí)候ext2部分報(bào)錯,直接被我屏蔽了include/configs/smdk6410.h中對應(yīng)的CONFIG_CMD_EXT2選項(xiàng)。
          include/configs/smdk6410.h中地址和MMU相關(guān)定義如下:
          TEXT_BASE在board/Samsung/smdk6410/config.mk中定義:TEXT_BASE=${RAM_TEXT}
          #if !defined(CONFIG_NAND_SPL) && (TEXT_BASE >= 0xc0000000)
          #define CONFIG_ENABLE_MMU
          #endif

          內(nèi)核配置和編譯
          Kernel版本:2.6.35
          CPU: arm1176 JZ-S
          BOARD: 友堅(jiān)6410 (基于samsung/smdk6410修改代碼)
          內(nèi)核配置編譯過程
          修改頂層Makefile:ARCH和CROSS_COMPILE定義
          ARCH ?= arm
          CROSS_COMPILE ?= arm-linux-

          內(nèi)核清除:make mrproper(會清除配置好的.config文件和所有.o文件,如果干凈的內(nèi)核沒有必要執(zhí)行)
          內(nèi)核配置:make menuconfig (可以依據(jù)一個(gè)相近的配置cp arch/arm/configs/s3c6400_defconfig ./.config)
          內(nèi)核編譯:make
          添加DM9000網(wǎng)卡驅(qū)動
          1)arch/arm/mach-s3c6410/mach-smdk6410.c

          #include
          ……


          #define S3C64XX_PA_DM9000 (0x1800030)
          #define S3C64XX_VA_DM9000 S3C_ADDR_CPU(0x01000000)
          #define S3C64XX_SZ_DM9000 SZ_1M

          static struct resource smdk6410_dm9000_resources[] = {
          [0] = {
          .start = S3C64XX_PA_DM9000,
          .end = S3C64XX_PA_DM9000 + 3,
          .flags = IORESOURCE_MEM
          },
          [1] = {
          .start = S3C64XX_PA_DM9000 + 4,
          .end = S3C64XX_PA_DM9000 + 255,
          .flags = IORESOURCE_MEM
          },
          [2] = {
          .start = IRQ_EINT(7),
          .end = IRQ_EINT(7),
          .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
          },
          };

          static struct dm9000_plat_data smdk6410_dm9000_pdata = {
          .flags = DM9000_PLATF_16BITONLY
          };

          struct platform_device smdk6410_dm9000 = {
          .name = "dm9000",
          .id = -1,
          .num_resources = ARRAY_SIZE(smdk6410_dm9000_resources),
          .resource = smdk6410_dm9000_resources,
          .dev = {
          .platform_data = &smdk6410_dm9000_pdata,
          }
          };

          ……

          static struct map_desc smdk6410_iodesc[] = {
          {
          .virtual = (unsigned long)S3C64XX_VA_DM9000,
          .pfn = __phys_to_pfn(S3C64XX_PA_DM9000),
          .length = S3C64XX_SZ_DM9000,
          .type = MT_DEVICE,
          },
          };

          static struct platform_device *smdk6410_devices[] __initdata = {
          #ifdef CONFIG_SMDK6410_SD_CH0
          &s3c_device_hsmmc0,
          #endif
          #ifdef CONFIG_SMDK6410_SD_CH1
          &s3c_device_hsmmc1,
          #endif
          &s3c_device_i2c0,
          &s3c_device_i2c1,
          &s3c_device_fb,
          &s3c_device_usb,
          &s3c_device_usb_hsotg,
          &smdk6410_lcd_powerdev,

          &smdk6410_dm9000,
          };
          NFS rootfs相關(guān)配置
          1、devices support 中打開DM9000支持
          2、打開filsystem 中nfs的相關(guān)支持
          --- Network File Systems
          │ │ <*> NFS client support
          │ │ [*] NFS client support for NFS version 3
          │ │ [ ] NFS client support for the NFSv3 ACL protocol extension
          │ │ [*] NFS client support for NFS version 4 (EXPERIMENTAL)
          │ │ [ ] NFS client support for NFSv4.1 (DEVELOPER ONLY)
          │ │ [*] Root file system on NFS

          備注:Linux啟動參數(shù)(uboot bootargs傳遞過來的)
          "console=ttySAC0,115200 root=/dev/nfs rw nfsroot=172.20.118.103:/work/workspace/s3c6410/rootfs ip=172.20.118.193:172.20.118.103:172.20.118.254:255.255.255.0:hoxm:eth0:none"
          停在Starting kernel問題解決
          常見原因:
          1)地址錯誤
          2)Boot參數(shù)設(shè)置錯誤
          3)串口fifo設(shè)置不必配(本次移植就是因?yàn)檫@個(gè)原因)
          archarmmach-s3c6400includemachuncompress.h 中添加uart fifo配置

          static void arch_detect_cpu(void)
          {

          fifo_mask = S3C_UFSTAT_TXMASK;
          fifo_max = 63 << S3C_UFSTAT_TXSHIFT;
          }

          根文件系統(tǒng)建立
          Download busybox

          #make menuconfig
          #make
          #make install
          busybox make,如果出現(xiàn)找不到crypt m庫的錯誤提示Trying libraries: crypt m Library crypt is needed, cant exclude it (yet) Library m is needed, cant exclude it (yet) Final link with: crypt m,可以不必理會,直接make install

          編譯bash
          export CC=arm-sunplus-linux-gnueabi-gcc
          ./configure --host=arm-sunplus-linux-gnueabi --enable-static-link --without-bash-malloc
          make
          make之后源碼包頂層目錄下生成bash,不用make install,直接copy到busybox的/bin目錄

          最簡單的默認(rèn)使用sh的根文件系統(tǒng)制作:
          busybox生成: /bin /sbin /usr/bin /usr/sbin
          mk空目錄:mkdir dev etc home lib mnt opt proc sys tmp var
          busybox /examples copy /etc下inittab,fstab,rc等相關(guān)腳本覆蓋到/etc中



          關(guān)鍵詞: Linuxs3c6410移

          評論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();