首页 > 系统相关 >尚观6410开发板移植linux 3.6.6问题记录及经验小结

尚观6410开发板移植linux 3.6.6问题记录及经验小结

时间:2023-09-24 19:45:05浏览次数:40  
标签:ramdisk ################################################################# ohci 6

原文:https://www.cnblogs.com/iwantcomputer/p/8489831.html

尚观6410开发板移植linux 3.6.6问题记录及经验小结

把开发板右上角的红色启动选项开关,两个都拨到下面(NAND),连接串口,已经内置了uboot 1.16。
根文件系统使用ext2的ramdisk,由于网卡无法驱动故无法使用nfs的根文件系统,网卡驱动问题待解决。

先安装ubuntu基本开发包:
    sudo apt-get install build-essential bison flex automake autoconf libncurses5-dev

配置arm-linux-gcc交叉编译环境

编译最新的linux 3.6.6内核,直接使用s3c6400_defconfig编译通过,且基本能用(dm9000网卡无法驱动)

安装uboot 的mkimage用于生成uImage及处理ramdisk:
    sudo apt-get install u-boot-tools

安装ramdisk生成工具:
    sudo apt-get install genext2fs

创建rootfs文件夹,创建最基本的根文件系统结构:
    mkdir bin sbin dev etc lib proc sys usr mnt tmp var root

编译busybox并安装到刚才创建的roofs目录下去

创建rootfs/etc/init.d/rcS文件:
   #!/bin/sh
    mdev -s
   /bin/sh
    #ifconfig eth0 192.168.1.150
    #mount -a    

rootfs生成最基本的设备文件:
    mknod -m 666 console c 5 1
    mknod -m 666 null c 1 3

加载ramdisk出现can't open /dev/tty2: No such file or directory,解决方法:
    ln -sf /dev/null /dev/tty2
    ln -sf /dev/null /dev/tty3
    ln -sf /dev/null /dev/tty4   

genext2fs用法:
    genext2fs -b [目标ramdisk文件大小,1024的整数倍] -d [rootfs所在文件夹名] [ramdisk文件名]
   -b后接的值就是生成的ramdisk的文件大小,不要设定太大,只要比rootfs所在文件夹稍大即可

用mkimage处理ramdisk示例(若不处理,则会提示bad magic number):
    mkimage -n "RAMFS" -A arm -O linux -T ramdisk -C none -a 51800000 -e 51800040 -d ramdisk ramdisk.img
   5180000是ramdisk在内存中的地址,51800040是偏移量,"ramdisk"是原ramdisk文件名,"ramdisk.img"是处理后的ramdisk文件名

加入busybox之后,制作的ramdisk无法启动,提示/linuxrc无法执行,可能的解决方法之一:
   需要把交叉编译工具链里面的库(至少要把/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/lib下面的所有文件)
      放到rootfs/lib下面,再重新打包ramdisk
   再确保有执行权限,chmod -R a+x rootfs

ramdisk不要使用gzip压缩,无论是mkimage处理后再压缩还是压缩后再处理,都无法启动.

加载根文件系统时提示:RAMDISK: image too big!解决方法:
   不需要重新编译内核,修改uboot的bootargs,在后面加上ramdisk_size=20480,这个值不能比ramdisk的文件小
   因为3.6.6内核默认的启动选项是优先加载bootloader传入的启动参数

一个使用ramdisk的根文件系统的bootargs示例如下:
    setenv bootargs root=/dev/ram rootfstype=ext2 init=/linuxrc console=ttySAC0,115200 ramdisk_size=20480 mem=128M



下一步目标,解决dm9000网卡驱动问题,并使用NFS挂载根文件系统。









U-Boot 1.1.6 (Sep 16 2011 - 14:10:18) for SMDK6410

****************************************
**    UP-S3C6410 Nand boot v0.18     **
**    ShenZhen Uplooking Technology   **
**   Http://www.uplooking.com       **
****************************************

CPU:    S3C6410@532MHz
        Fclk = 532MHz, Hclk = 133MHz, Pclk = 66MHz, Serial = CLKUART (SYNC Mode)
Board:   SMDK6410
DRAM:    128 MB
Flash:   0 kB
NAND:    256 MB
In:     serial
Out:    serial
Err:    serial
dm9000 i/o: 0x18000300, id: 0x90000a46
MAC: 00:40:5c:26:0a:5b
operating at unknown: 15 mode
Hit any key to stop autoboot:  0
uplooking # tftp 0x50800000 zImage
dm9000 i/o: 0x18000300, id: 0x90000a46
MAC: 00:40:5c:26:0a:5b
operating at 100M full duplex mode
TFTP from server 192.168.1.103; our IP address is 192.168.1.150
Filename 'zImage'.
Load address: 0x50800000
Loading: #################################################################
        #################################################################
        #################################################################
        #################################################################
        ###############################
done
Bytes transferred = 1488096 (16b4e0 hex)
uplooking # tftp 0x51800000 ramdisk.img
dm9000 i/o: 0x18000300, id: 0x90000a46
MAC: 00:40:5c:26:0a:5b
operating at 100M full duplex mode
TFTP from server 192.168.1.103; our IP address is 192.168.1.150
Filename 'ramdisk.img'.
Load address: 0x51800000
Loading: #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        ########################
done
Bytes transferred = 9437248 (900040 hex)
uplooking # bootm 0x50800000 0x51800000
Boot with zImage
## Loading Ramdisk Image at 51800000 ...
   Image Name:   RAMFS
  Created:     2012-11-13  13:01:59 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    9437184 Bytes =  9 MB
   Load Address: 51800000
   Entry Point: 51800040
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.6.6 (root@zhufeng-ThinkCentre) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #1 Tue Nov 13 15:31:35 CST 2
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: SMDK6410
Memory policy: ECC disabled, Data cache writeback
CPU S3C6410 (id 0x36410101)
S3C24XX Clocks, Copyright 2004 Simtec Electronics
camera: no parent clock specified
S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000
S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000
mout_apll: source is fout_apll (1), rate is 532000000
mout_epll: source is epll (1), rate is 24000000
mout_mpll: source is mpll (1), rate is 532000000
usb-bus-host: source is clk_48m (0), rate is 48000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
audio-bus: source is mout_epll (0), rate is 24000000
irda-bus: source is mout_epll (0), rate is 24000000
camera: no parent clock specified
CPU: found DTCM0 8k @ 00000000, not enabled
CPU: moved DTCM0 8k to fffe8000, enabled
CPU: found DTCM1 8k @ 00000000, not enabled
CPU: moved DTCM1 8k to fffea000, enabled
CPU: found ITCM0 8k @ 00000000, not enabled
CPU: moved ITCM0 8k to fffe0000, enabled
CPU: found ITCM1 8k @ 00000000, not enabled
CPU: moved ITCM1 8k to fffe2000, enabled
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: root=/dev/ram rootfstype=ext2 init=/linuxrc console=ttySAC0,115200 ramdisk_size=20480 mem=128M
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 117552k/117552k available, 13520k reserved, 0K highmem
Virtual kernel memory layout:
   vector  : 0xffff0000 - 0xffff1000  (   4 kB)
   DTCM    : 0xfffe8000 - 0xfffec000  (  16 kB)
   ITCM    : 0xfffe0000 - 0xfffe4000  (  16 kB)
   fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
   lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000  (  16 MB)
     .text : 0xc0008000 - 0xc028d5bc  (2582 kB)
     .init : 0xc028e000 - 0xc02ab12c  ( 117 kB)
     .data : 0xc02ac000 - 0xc02d86c0  ( 178 kB)
      .bss : 0xc02d9024 - 0xc030a0a0  ( 197 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:246
VIC @f6000000: id 0x00041192, vendor 0x41
VIC @f6010000: id 0x00041192, vendor 0x41
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop... 353.89 BogoMIPS (lpj=1769472)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x501e5bb0 - 0x501e5c0c
DMA: preallocated 256 KiB pool for atomic coherent allocations
s3c64xx_dma_init: Registering DMA channels
PL080: IRQ 73, at c8846000, channels 0..8
PL080: IRQ 74, at c8848000, channels 8..16
S3C6410: Initialising architecture
bio: create slab at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
s3c-i2c s3c2440-i2c.0: slave address 0x10
s3c-i2c s3c2440-i2c.0: bus frequency set to 64 KHz
s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter
s3c-i2c s3c2440-i2c.1: slave address 0x10
s3c-i2c s3c2440-i2c.1: bus frequency set to 64 KHz
s3c-i2c s3c2440-i2c.1: i2c-1: S3C I2C adapter
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (junk in compressed archive); looks like an initrd
Freeing initrd memory: 9216K
ROMFS MTD (C) 2007 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
start plist test
end plist test
s3c-fb s3c-fb: window 0: fb
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10
console [ttySAC0] enabled
s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10
s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10
s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10
brd: module loaded
loop: module loaded
at24 0-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
at24 1-0057: 16384 byte 24c128 EEPROM, writable, 1 bytes/write
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000
s3c2410-ohci s3c2410-ohci: init err (00000000 0000)
s3c2410-ohci s3c2410-ohci: can't start s3c24xx
s3c2410-ohci s3c2410-ohci: startup error -75
s3c2410-ohci s3c2410-ohci: USB bus 1 deregistered
s3c2410-ohci: probe of s3c2410-ohci failed with error -75
mousedev: PS/2 mouse device common for all mice
s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling
s3c-rtc s3c64xx-rtc: rtc core: registered s3c as rtc0
i2c /dev entries driver
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
s3c-sdhci s3c-sdhci.0: clock source 0: mmc_busclk.0 (133000000 Hz)
s3c-sdhci s3c-sdhci.0: clock source 2: mmc_busclk.2 (24000000 Hz)
mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using ADMA
mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
mmc0: mmc_rescan_try_freq: trying to init card at 300000 Hz
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
s3c-rtc s3c64xx-rtc: setting system clock to 2012-11-13 21:03:42 UTC (1352840622)
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 9216KiB [1 disk] into ram disk... mmc0: mmc_rescan_try_freq: trying to init card at 200000 Hz
mmc0: mmc_rescan_try_freq: trying to init card at 100000 Hz
done.
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing init memory: 116K
mdev: /sys/class: No such file or directory
/bin/sh: can't access tty; job control turned off
/ # uname -a
Linux (none) 3.6.6 #1 Tue Nov 13 15:31:35 CST 2012 armv6l GNU/Linux
/ #

标签:ramdisk,#################################################################,ohci,6
From: https://www.cnblogs.com/bruce1992/p/17726505.html

相关文章

  • 阿波罗H743开发板串口下载0KB出错,使用STLINK解决方法
    导师那边的博后给了一块正点原子的阿波罗H743(非常不好意思地花了人家600+,我还以为是实验室那边本来就有的开发板给我学习呢,结果给我买了全新的还带一个wifi模块,越发觉得任重道远今天尝试连电脑使用,并按照原子那边的教程用flyMCU下载hex文件,反正就是用它一下载,第一遍烧录可以,第二......
  • 虚拟机和开发板之间通过NFS互联
    简介NFS是NetworkFileSystem的首字母缩写。它是一种分布式协议,使客户端可以访问远程服务器上的共享文件。它允许网络中的计算机之间通过TCP/IP网络共享资源。配置过程安装NFS服务端sudoapt-getinstallnfs-kernel-server遇到提示:输入Y,同意。VMware桥接模式的设置VMwar......
  • 关于GEC6818开发板常用命令
    cd目录路径cd用于切换路径(文件夹/目录),用来切换终端的工作路径到指定目录中去格式:cd路径名cd.表示进入当前目录cd..表示进入上一级目录cd/main/mainls列举ls列出指定目录下的文件名,可以用来查看当前工作路径下所有的文件信息格式:ls路径名lsmainlsbmpmkdir创建......
  • 关于GEC6818开发板常用命令
    cd目录路径cd用于切换路径(文件夹/目录),用来切换终端的工作路径到指定目录中去格式:cd路径名cd.表示进入当前目录cd..表示进入上一级目录cd/main/mainls列举ls列出指定目录下的文件名,可以用来查看当前工作路径下所有的文件信息格式:ls路径名lsmainlsbmpmkdir创建一......
  • iTOP-RK3588开发板更新RKNN模型
    RKNN是RockchipNPU平台(也就是开发板)使用的模型类型,是以.rknn结尾的模型文件。RKNNSDK提供的demo程序中默认自带了RKNN模型,在RKNNSDK的examples/rknn_yolov5_demo/model/RK3588/目录下,如下图所示:如使用自己的模型需要转换成rknn模型,转换方法可以参考......
  • Gowin_9K FPGA开发板介绍
    一板卡简介高云半导体GW1NR系列FPGA产品是高云半导体小蜜蜂®(LittleBee®)家族第一代产品,是一款系统级封装芯片,在GW1N基础上集成了丰富容量的存储芯片,同时具有低功耗、瞬时启动、低成本、非易失性、高安全性、封装类型丰富、使用方便灵活等特点。Gowin_9KFPGA板采......
  • RK3568开发板SG90 舵机模块的功能实现-迅为电子
     1模块说明SG90舵机模块如下图所示:   常见的舵机转向角度有0-90度,0-180度,0-360度,可以用在垃圾桶项目开盖用,智能小车的全比例转向,摄像头云台,机械臂等。 2接线说明SG90舵机模块上三条线,三条线定义如下:棕线:GND红线:VCC4.8V-7.2V黄线:脉冲输入 3程序测试......
  • 【WCH蓝牙系列芯片】-基于CH582开发板—四种低功耗模式电流测试
    ---------------------------------------------------------------------------------------------------------------------在WCH沁恒官方提供的CH583的EVT资源包中,找到BLE文件中找到PW这个工程文件,这是一个系统睡眠模式并唤醒例程;其中GPIOA_5作为唤醒源,共4种功耗等级。芯片提......
  • FPGA开发板实验目录
     数字逻辑基础实验   实验文件夹名称   实验说明   lab1   4位并入串出移位寄存器   lab2   4位串入串出移位寄存器   lab3   5位串入并出移位寄存器   lab4   8线-3线编码器   lab5   8线-3线优先编码器   lab6   38......
  • 分析开发板信息中为啥df -h显示sda11分区挂载只有2GB Size且使用100%,但fdisk -l sda11
    问题点当使用开发板中的存储设备分区,进而格式化挂载到某个目录上后,使用df&lsblk后发现分区挂载情况和实际的存储器分区信息有差异后,会感到很疑惑,下面介绍遇到的情况:情况1使用xml添加分区后发现对应分区格式化&挂载对应设置的系统目录上但分区sizeAvailablesize&Used之和不相......