SlideShare uma empresa Scribd logo
1 de 39
Embedded System on SD

Vincent Chen
Annie Cheng
YuChin Huang
Jason Kung
2013-09-18
Motivation
Typically, most embedded systems load system from NAND flash on the target
device. That means the boot loader, kernel and file system are fused on the NAND
flash.
However, in the beginning stage of implementation, the NAND flash is totally empty,
which means, at least, we have to fuse boot loader into the NAND flash, and then
fuse kernel and file system to bring up the system.

To fuse the boot loader into NAND flash is not easy as just copy a file. We have to
use specific tools like chip programmer or JTAG. Some of these tools are
expensive or not easy to get. Users also need to wait patiently while programming
a NAND flash because it takes time. Frequently programming NAND flash also
impacts its endurance due to its physical character. Thus, if we can find a way to
build a system on other external storage device, like SD card, it would be save a lot
of time, cost, and even NAND flash life cycle.
Embedded System (boot from NAND)

SD I/F

Boot Loader

CPU
Memory
controller

NAND flash
controller

Kernel

Memory

NAND
File System
Embedded System (SD recovery mode)

SD I/F

Boot Loader
SD / SDHC

CPU
Memory
controller

NAND flash
controller

Kernel

Memory

NAND
File System
Embedded System (boot from SD)

SD I/F

Boot Loader
SD / SDHC

CPU
Memory
controller

NAND flash
controller

Kernel

Memory

NAND
File System
Purpose
- Build the embedded system on SD card
- Loading system from SD card completely without NAND flash support.
- The file system on SD card supports read and write facility.
- Implement a utility to fuse boot loader, kernel and file system to SD card easily.

Replace boot from NAND
Load u-boot
Loader Kernel
Load File system
File system readable / writable












Benefits
- System is easy to recover/update
just simply replace the SD card.

- Cost down
NAND/NOR flash become optional, not a necessary component anymore.
It saves BOM cost.

- Product in test stage
Modify/update codes easily.

- Multi-OS in one device
Switch OS among different SD cards.
Platform - DMA6410L
- AP: Samsung S3C6410XH-66, 667Mhz
- RAM: mDDR 128MB (64MB * 2)
- Ethernet I/F: DM9000AE

- Display: 4.3” TFT (480*272)
- UART: UART * 1 (for debug)
- SD card I/F: SD card slot * 1
How …
To achieve system on SD card, we will face the following issues,

- CPU supports boot from SD card. How does it work?

- An embedded system has three parts: u-boot (boot loader), kernel and file system.
We have to know the exact position in SD card.

- SD card has SDSC (Standard-Capacity), SDHC (High-Capacity) and SDXC
(eXtended-Capacity.) Does all of them can be supported by CPU?

- How to make the boot loader loads kernel and than kernel loads file system
exactly?
Boot Loader (u-boot)
S3C6410 iROM booting
S3C6410
ARM1176JZF-S

SDRAM
Controller

SDRAM
Booting Device
(SD/MMC Card,
OneNAND, Nand)

Stepping
Stone (8KB)

iROM(BL0)
(32KB)

OM=iROM Boot

HS-MMC
Controller

BL2

Kernel

OneNAND
Controller

D-TCM (16KB)

BL1
(8KB)

File
System

NAND
Controller

GPN[15:13]:Booting
device pin selection

1.iROM supports initial boot up
Initialize system clock, D-TCM,
device specific controller and
booting device.
S3C6410 iROM booting

(cont.)

S3C6410
ARM1176JZF-S

SDRAM
Controller

SDRAM
Booting Device
(SD/MMC Card,
OneNAND, Nand)

Stepping
Stone (8KB)

iROM(BL0)
(32KB)

OM=iROM Boot

HS-MMC
Controller

BL2

Kernel

OneNAND
Controller

D-TCM (16KB)

BL1
(8KB)

File
System

NAND
Controller

GPN[15:13]:Booting
device pin selection

2.iROM boot codes can load 8KB of
boot loader to stepping stone.
The 8 KB boot loader is called
BL1.
S3C6410 iROM booting

(cont.)

S3C6410
ARM1176JZF-S

SDRAM
Controller

SDRAM
Booting Device
(SD/MMC Card,
OneNAND, Nand)

Stepping
Stone (8KB)

iROM(BL0)
(32KB)

OM=iROM Boot

HS-MMC
Controller

BL2

Kernel

OneNAND
Controller

D-TCM (16KB)

BL1
(8KB)

File
System

NAND
Controller

GPN[15:13]:Booting
device pin selection

3.BL1 can initialize system clock,
UART, and SDRAM for user.
After initializing, BL1 will load the
remaining boot loader called BL2
to SDRAM.
S3C6410 iROM booting

(cont.)

S3C6410
ARM1176JZF-S

SDRAM
Controller

SDRAM
Booting Device
(SD/MMC Card,
OneNAND, Nand)

Stepping
Stone (8KB)

iROM(BL0)
(32KB)

OM=iROM Boot

HS-MMC
Controller

BL2

Kernel

OneNAND
Controller

D-TCM (16KB)

BL1
(8KB)

File
System

NAND
Controller

GPN[15:13]:Booting
device pin selection

4.Finally, jump to start address of
BL2. That will make good
environment to use system.
SD/SDHC Device Block Assignment

1 Block = 512 bytes

SD/MMC Device
File System

Kernel

BL2

BL1

Signature

Reserved

(4MB)

(256KB)

(8KB)

(512B)

(512B)

8192

512

16

1

1
Last

1 Block = 512 bytes

SDHC Device
File System

Kernel
(4MB)

BL2
(256KB)

8192

512

BL1 Signature
(8KB) (1024B)
16

2

Skipped
(512KB)
1024
Last
For Instance …
2 GB SD

4 GB SDHC

2,021,654,528 bytes
3,958,544 blocks

3,965,190,144 bytes
7,744,512 blocks

File System

File System

3,939,822

7,734,766
Kernel

Kernel

8,192 blocks

3,948,014
BL2

BL2

512 blocks

3,948,526

8,192 blocks

7,742,958

512 blocks

7,743,470
BL1

BL1
16 blocks

3,958,542

3,958,544

16 blocks

7,743,486

Last
2 blocks
1 Block = 512 bytes

7,744,488
7,744,512

Last
Skipped

2 blocks
1,024 blocks
1 Block = 512 bytes
Screenshot (boot from 2G SD)
2 GB SD
2,021,654,528 bytes
3,958,544 blocks

File System

2GB SD
3,939,822
Kernel

8,192 blocks

3,948,014
BL2

512 blocks

3,948,526
BL1

16 blocks

3,958,542

3,958,544

Last
2 blocks
1 Block = 512 bytes
Screenshot (boot from 4G SD)
4 GB SDHC
3,965,190,144 bytes
7,744,512 blocks

File System

4GB SD
7,734,766
Kernel

8,192 blocks

7,742,958
BL2

512 blocks

7,743,470
BL1

16 blocks

7,743,486
7,744,488
7,744,512

Last
Skipped

2 blocks
1,024 blocks
1 Block = 512 bytes
smdk6410.h
Bootloaderu-bootincludeconfigssmdk6410.h
/***********************************************************
* Command definition
***********************************************************/
#define CONFIG_COMMANDS

(CONFIG_CMD_DFL
| 
CFG_CMD_CACHE
| 
CFG_CMD_USB
| 
CFG_CMD_REGINFO
| 
Add CFG_CMD_MOVINAND
CFG_CMD_LOADS
| 
CFG_CMD_LOADB
| 
to make u-boot supports
CFG_CMD_ENV
| 
movinand (SD/MMC)
CFG_CMD_NAND
| 
CFG_CMD_MOVINAND
| 
CFG_CMD_RUN
| 
CFG_CMD_DATE
| 
CFG_CMD_PING
| 
CFG_CMD_ELF)

& ~(CFG_CMD_AUTOSCRIPT
| 
CFG_CMD_BOOTD
| 
CFG_CMD_IMI
| 
CFG_CMD_CONSOLE | 
0)
smdk6410.h

(cont.)

Bootloaderu-bootincludeconfigssmdk6410.h
/* Boot configuration (define only one of next 3) */
//#define CONFIG_BOOT_NOR
// #define CONFIG_BOOT_NAND
Make u-boot boots from
#define CONFIG_BOOT_MOVINAND
movinand
//#define CONFIG_BOOT_ONENAND
//#define CONFIG_BOOT_ONENAND_IROM

#define CONFIG_NAND
//#define CONFIG_ONENAND
#define CONFIG_MOVINAND
//#define CONFIG_MMC
//#define CONFIG_MMC_S3C
//#define CFG_MMC_BASE
//#define CFG_MMC_BASE

1
1
0xff000000
0xf0000000

bootcmd setting
#elif defined(CONFIG_BOOT_MOVINAND)
#define CFG_ENV_IS_IN_MOVINAND
#define CONFIG_BOOTCOMMAND "movi read zImage c0008000;bootm c0008000"
movi.h
Bootloaderu-bootincludemovi.h
#if defined(CONFIG_S3C2450) || defined(CONFIG_S3C2416)
#define HSMMC_CHANNEL
1
Define HSMMC_CHANNEL
#else
#define HSMMC_CHANNEL
1
//0-->TF 1--> SD
#endif

/* offset information */
#define PART_UBOOT_OFFSET
#define PART_ZIMAGE_OFFSET
#define PART_ROOTFS_OFFSET
#define PART_EXTRA_OFFSET

/* movinand definitions */
#define MOVI_BLKSIZE

0x0
0x40000
0x440000
0x3200000

512

Offset in movinand (SD card)

**refer page 16
Block size definition
1 block = 512 bytes
movi.h

(cont.)

Bootloaderu-bootincludemovi.h
#define
#define
#define
#define

MOVI_LAST_BLKPOS
MOVI_BL1_BLKCNT
MOVI_ENV_BLKCNT
MOVI_BL2_BLKCNT

#define MOVI_ZIMAGE_BLKCNT
#define MOVI_BL2_POS
#define MOVI_ROOTFS_BLKCNT

(MOVI_TOTAL_BLKCNT - (eFUSE_SIZE / MOVI_BLKSIZE))
(SS_SIZE / MOVI_BLKSIZE)
(CFG_ENV_SIZE / MOVI_BLKSIZE)
(((PART_ZIMAGE_OFFSET - PART_UBOOT_OFFSET) /
MOVI_BLKSIZE) - MOVI_ENV_BLKCNT)
((PART_ROOTFS_OFFSET - PART_ZIMAGE_OFFSET) /
MOVI_BLKSIZE)
(MOVI_LAST_BLKPOS - MOVI_BL1_BLKCNT –
MOVI_BL2_BLKCNT - MOVI_ENV_BLKCNT)
8 * 1024 * 1024 / MOVI_BLKSIZE
//(PART_SIZE_ROOTFS / MOVI_BLKSIZE)

According to the formulas above, we can easily calculate the exact position of each
segment.
(you can check the following excel file to get more detailed information.)

**refer page 16
hs_mmc.c
Bootloaderu-bootcpus3c64xxhs_mmc.c
int hsmmc_init (void)
{
u32 reg;
uint width;

issue_command(MMC_GO_IDLE_STATE, 0x00, 0, 0);

issue_command(MMC_SEND_EXT_CSD, 0x000001AA, 0, MMC_RSP_R1);

Add this statement to initial
SDHC

/* MMC_SET_BLOCKLEN */
while (!issue_command(MMC_SET_BLOCKLEN, 512, 0, MMC_RSP_R1));
s3c_hsmmc_writew(0xffff, HM_NORINTSTS);
return 0;
}
Kernel (zImage)
Kernel Configuration
Kernel Configuration (cont.)
Kernel Configuration (cont.)
Kernel Configuration (cont.)
Environment Setting - bootcmd
setenv bootcmd “movi read zImage c0008000;bootm c0008000”
**refer page 21
File System
Environment Setting - bootargs
setenv bootargs “root=/dev/mmcblk0p2 rootfstype=ext3 rootdelay=3 init=/linuxrc
console=ttySAC0,115200”
**set bootargs at smdk6410.h
Screenshot
Note: The root file system is pre-built in SD card.
Fusing Tool
Fusing Tool
To fuse the boot loader (u-boot.bin), kernel (zImage), and file system (rootfs.tar) to
SD card automatically.
sdcard=$1
if [ "$sdcard" = "" ];then
echo " # Usage - ./sd.sh /dev/SDcardDevicename (ex. sd.sh /dev/sdc)"
echo " # prepare the necessary files(zImage,rootfs.tar,uboot.bin
rootfs.tar is a tar.bz2 file)"
echo " # and verify that the device is correct"
exit 0

.
mkdir /mnt1
mount ${sdcard}2 /mnt1
tar -jxvf rootfs.tar -C /mnt1
cp -rap /mnt/rootfs/* /mnt1
umount /mnt1
rm -rf /mnt1
How to use the fusing tool
root@Linux:~# ./sd4.sh /dev/sdc

1. Run the shell script “sd4.sh” as root.
2. Assign the block device where the SD card exists (ex. /dev/sdc).
3. The root file system has to be packed as rootfs.tar before running this shell
script.
4. The boot loader (u-boot.bin), kernel (zImage) and the file system (rootfs.tar)
must exist in the same folder.
5. The name of the files u-boot.bin, zImage, and rootfs.tar are fixed, casesensitive.
How the shell script works
step

command

1. Check the device user enters exists and make sure it is an SD card.
2. Partition the device (two partitions will be made).

fdisk

3. Format the second partition as ext3.

mkfs.ext3

4. Fuse the first 8k of u-boot.bin to the BL1 area of the SD card.

dd

5. Fuse the u-boot.bin to the BL2 area of he SD card.
(u-boot.bin has to be smaller than 256KB)

dd

6. Fuse the zImage to the kernel area of he SD card.

dd

7. Make a directory named /mnt1 as the mount point

mkdir

8. Mount the second partition (ext3) to the mount point (/mnt1).

mount

9. Extract rootfs.tar to /mnt1

Tar

10. Un-mount the mount point (/mnt1)

umount

11. Delete the mount point (/mnt1)

rm
Member Introduction
Member Introduction
Name

Education
Background

Tasks of the project

Working
Experience

Vincent Chen
(Team Leader)

Lan Yang Institute of Technology
BS. Electronics Engineering

- Kernel implement:
- MTD support
- MMC/SD card support
- Kernel logo display

- R&D Engineer
(Electric Meters)
- Field Application Engineer

Annie Cheng

Ming Hsin University of Science and
Technology
BS. In Electronic Engineering

- Hardware layout tracing for
SD/SDHC boot
- Documentation

- Senior Validation Engineer
(CPU Electrical / Margining)
- System Validation Test
Engineer

YiChin Huang

Chih Lee Institute of Technology
BS. in Information Management

- U-boot support SDHC
implement
- SD card fusing tool implement

Jason Kung

Texas A&M University - Commerce
MS. In Computer Science
MS. In Management

- U-boot support SD implement
- Kernel, File System
(ext3, readable/writable)on SD

- Field Application Engineer
(ARM Application Processor)
- Product Manager
(ARM Application Processor)
Thank You

Mais conteúdo relacionado

Mais procurados

Zynq MPSoC勉強会 Codec編
Zynq MPSoC勉強会 Codec編Zynq MPSoC勉強会 Codec編
Zynq MPSoC勉強会 Codec編Tetsuya Morizumi
 
Q4.11: Introduction to eMMC
Q4.11: Introduction to eMMCQ4.11: Introduction to eMMC
Q4.11: Introduction to eMMCLinaro
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchlinuxlab_conf
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtAnne Nicolas
 
DMA Survival Guide
DMA Survival GuideDMA Survival Guide
DMA Survival GuideKernel TLV
 
Continguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelContinguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelKernel TLV
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver艾鍗科技
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Macpaul Lin
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Linaro
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLinaro
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
 
Universal flash storage
Universal flash storageUniversal flash storage
Universal flash storageDooyong Lee
 

Mais procurados (20)

Zynq MPSoC勉強会 Codec編
Zynq MPSoC勉強会 Codec編Zynq MPSoC勉強会 Codec編
Zynq MPSoC勉強会 Codec編
 
Q4.11: Introduction to eMMC
Q4.11: Introduction to eMMCQ4.11: Introduction to eMMC
Q4.11: Introduction to eMMC
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
 
DMA Survival Guide
DMA Survival GuideDMA Survival Guide
DMA Survival Guide
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
Continguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelContinguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux Kernel
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
Universal flash storage
Universal flash storageUniversal flash storage
Universal flash storage
 
Embedded Hypervisor for ARM
Embedded Hypervisor for ARMEmbedded Hypervisor for ARM
Embedded Hypervisor for ARM
 

Semelhante a 建構嵌入式Linux系統於SD Card

Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Ron Munitz
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersProfessorLance
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersProfessorLance
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogicAleem Shariff
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
Когда предрелизный не только софт
Когда предрелизный не только софтКогда предрелизный не только софт
Когда предрелизный не только софтCEE-SEC(R)
 
COMPUTER HARDWARE - SHORT NOTES
COMPUTER HARDWARE - SHORT NOTESCOMPUTER HARDWARE - SHORT NOTES
COMPUTER HARDWARE - SHORT NOTESsuthi
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android EmulatorSamael Wang
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyLinaro
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingMarian Marinov
 
Introduction to Computer Hardware slides ppt
Introduction to Computer Hardware slides pptIntroduction to Computer Hardware slides ppt
Introduction to Computer Hardware slides pptOsama Yousaf
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial艾鍗科技
 

Semelhante a 建構嵌入式Linux系統於SD Card (20)

Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Когда предрелизный не только софт
Когда предрелизный не только софтКогда предрелизный не только софт
Когда предрелизный не только софт
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
COMPUTER HARDWARE - SHORT NOTES
COMPUTER HARDWARE - SHORT NOTESCOMPUTER HARDWARE - SHORT NOTES
COMPUTER HARDWARE - SHORT NOTES
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android Emulator
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case study
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
Introduction to Computer Hardware slides ppt
Introduction to Computer Hardware slides pptIntroduction to Computer Hardware slides ppt
Introduction to Computer Hardware slides ppt
 
101 1.1 hardware settings
101 1.1 hardware settings101 1.1 hardware settings
101 1.1 hardware settings
 
P1 unit 2
P1 unit 2P1 unit 2
P1 unit 2
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 

Mais de 艾鍗科技

TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition 艾鍗科技
 
Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab艾鍗科技
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用艾鍗科技
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation艾鍗科技
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge艾鍗科技
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介艾鍗科技
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 艾鍗科技
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進艾鍗科技
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆艾鍗科技
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作艾鍗科技
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車艾鍗科技
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作 艾鍗科技
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車 艾鍗科技
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning艾鍗科技
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統艾鍗科技
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home艾鍗科技
 

Mais de 艾鍗科技 (20)

TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge
 
Openvino ncs2
Openvino ncs2Openvino ncs2
Openvino ncs2
 
Step motor
Step motorStep motor
Step motor
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron)
 
3. data features
3. data features3. data features
3. data features
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

建構嵌入式Linux系統於SD Card

  • 1. Embedded System on SD Vincent Chen Annie Cheng YuChin Huang Jason Kung 2013-09-18
  • 2. Motivation Typically, most embedded systems load system from NAND flash on the target device. That means the boot loader, kernel and file system are fused on the NAND flash. However, in the beginning stage of implementation, the NAND flash is totally empty, which means, at least, we have to fuse boot loader into the NAND flash, and then fuse kernel and file system to bring up the system. To fuse the boot loader into NAND flash is not easy as just copy a file. We have to use specific tools like chip programmer or JTAG. Some of these tools are expensive or not easy to get. Users also need to wait patiently while programming a NAND flash because it takes time. Frequently programming NAND flash also impacts its endurance due to its physical character. Thus, if we can find a way to build a system on other external storage device, like SD card, it would be save a lot of time, cost, and even NAND flash life cycle.
  • 3. Embedded System (boot from NAND) SD I/F Boot Loader CPU Memory controller NAND flash controller Kernel Memory NAND File System
  • 4. Embedded System (SD recovery mode) SD I/F Boot Loader SD / SDHC CPU Memory controller NAND flash controller Kernel Memory NAND File System
  • 5. Embedded System (boot from SD) SD I/F Boot Loader SD / SDHC CPU Memory controller NAND flash controller Kernel Memory NAND File System
  • 6. Purpose - Build the embedded system on SD card - Loading system from SD card completely without NAND flash support. - The file system on SD card supports read and write facility. - Implement a utility to fuse boot loader, kernel and file system to SD card easily. Replace boot from NAND Load u-boot Loader Kernel Load File system File system readable / writable          
  • 7. Benefits - System is easy to recover/update just simply replace the SD card. - Cost down NAND/NOR flash become optional, not a necessary component anymore. It saves BOM cost. - Product in test stage Modify/update codes easily. - Multi-OS in one device Switch OS among different SD cards.
  • 8. Platform - DMA6410L - AP: Samsung S3C6410XH-66, 667Mhz - RAM: mDDR 128MB (64MB * 2) - Ethernet I/F: DM9000AE - Display: 4.3” TFT (480*272) - UART: UART * 1 (for debug) - SD card I/F: SD card slot * 1
  • 9. How … To achieve system on SD card, we will face the following issues, - CPU supports boot from SD card. How does it work? - An embedded system has three parts: u-boot (boot loader), kernel and file system. We have to know the exact position in SD card. - SD card has SDSC (Standard-Capacity), SDHC (High-Capacity) and SDXC (eXtended-Capacity.) Does all of them can be supported by CPU? - How to make the boot loader loads kernel and than kernel loads file system exactly?
  • 11. S3C6410 iROM booting S3C6410 ARM1176JZF-S SDRAM Controller SDRAM Booting Device (SD/MMC Card, OneNAND, Nand) Stepping Stone (8KB) iROM(BL0) (32KB) OM=iROM Boot HS-MMC Controller BL2 Kernel OneNAND Controller D-TCM (16KB) BL1 (8KB) File System NAND Controller GPN[15:13]:Booting device pin selection 1.iROM supports initial boot up Initialize system clock, D-TCM, device specific controller and booting device.
  • 12. S3C6410 iROM booting (cont.) S3C6410 ARM1176JZF-S SDRAM Controller SDRAM Booting Device (SD/MMC Card, OneNAND, Nand) Stepping Stone (8KB) iROM(BL0) (32KB) OM=iROM Boot HS-MMC Controller BL2 Kernel OneNAND Controller D-TCM (16KB) BL1 (8KB) File System NAND Controller GPN[15:13]:Booting device pin selection 2.iROM boot codes can load 8KB of boot loader to stepping stone. The 8 KB boot loader is called BL1.
  • 13. S3C6410 iROM booting (cont.) S3C6410 ARM1176JZF-S SDRAM Controller SDRAM Booting Device (SD/MMC Card, OneNAND, Nand) Stepping Stone (8KB) iROM(BL0) (32KB) OM=iROM Boot HS-MMC Controller BL2 Kernel OneNAND Controller D-TCM (16KB) BL1 (8KB) File System NAND Controller GPN[15:13]:Booting device pin selection 3.BL1 can initialize system clock, UART, and SDRAM for user. After initializing, BL1 will load the remaining boot loader called BL2 to SDRAM.
  • 14. S3C6410 iROM booting (cont.) S3C6410 ARM1176JZF-S SDRAM Controller SDRAM Booting Device (SD/MMC Card, OneNAND, Nand) Stepping Stone (8KB) iROM(BL0) (32KB) OM=iROM Boot HS-MMC Controller BL2 Kernel OneNAND Controller D-TCM (16KB) BL1 (8KB) File System NAND Controller GPN[15:13]:Booting device pin selection 4.Finally, jump to start address of BL2. That will make good environment to use system.
  • 15. SD/SDHC Device Block Assignment 1 Block = 512 bytes SD/MMC Device File System Kernel BL2 BL1 Signature Reserved (4MB) (256KB) (8KB) (512B) (512B) 8192 512 16 1 1 Last 1 Block = 512 bytes SDHC Device File System Kernel (4MB) BL2 (256KB) 8192 512 BL1 Signature (8KB) (1024B) 16 2 Skipped (512KB) 1024 Last
  • 16. For Instance … 2 GB SD 4 GB SDHC 2,021,654,528 bytes 3,958,544 blocks 3,965,190,144 bytes 7,744,512 blocks File System File System 3,939,822 7,734,766 Kernel Kernel 8,192 blocks 3,948,014 BL2 BL2 512 blocks 3,948,526 8,192 blocks 7,742,958 512 blocks 7,743,470 BL1 BL1 16 blocks 3,958,542 3,958,544 16 blocks 7,743,486 Last 2 blocks 1 Block = 512 bytes 7,744,488 7,744,512 Last Skipped 2 blocks 1,024 blocks 1 Block = 512 bytes
  • 17. Screenshot (boot from 2G SD) 2 GB SD 2,021,654,528 bytes 3,958,544 blocks File System 2GB SD 3,939,822 Kernel 8,192 blocks 3,948,014 BL2 512 blocks 3,948,526 BL1 16 blocks 3,958,542 3,958,544 Last 2 blocks 1 Block = 512 bytes
  • 18. Screenshot (boot from 4G SD) 4 GB SDHC 3,965,190,144 bytes 7,744,512 blocks File System 4GB SD 7,734,766 Kernel 8,192 blocks 7,742,958 BL2 512 blocks 7,743,470 BL1 16 blocks 7,743,486 7,744,488 7,744,512 Last Skipped 2 blocks 1,024 blocks 1 Block = 512 bytes
  • 19. smdk6410.h Bootloaderu-bootincludeconfigssmdk6410.h /*********************************************************** * Command definition ***********************************************************/ #define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_CACHE | CFG_CMD_USB | CFG_CMD_REGINFO | Add CFG_CMD_MOVINAND CFG_CMD_LOADS | CFG_CMD_LOADB | to make u-boot supports CFG_CMD_ENV | movinand (SD/MMC) CFG_CMD_NAND | CFG_CMD_MOVINAND | CFG_CMD_RUN | CFG_CMD_DATE | CFG_CMD_PING | CFG_CMD_ELF) & ~(CFG_CMD_AUTOSCRIPT | CFG_CMD_BOOTD | CFG_CMD_IMI | CFG_CMD_CONSOLE | 0)
  • 20. smdk6410.h (cont.) Bootloaderu-bootincludeconfigssmdk6410.h /* Boot configuration (define only one of next 3) */ //#define CONFIG_BOOT_NOR // #define CONFIG_BOOT_NAND Make u-boot boots from #define CONFIG_BOOT_MOVINAND movinand //#define CONFIG_BOOT_ONENAND //#define CONFIG_BOOT_ONENAND_IROM #define CONFIG_NAND //#define CONFIG_ONENAND #define CONFIG_MOVINAND //#define CONFIG_MMC //#define CONFIG_MMC_S3C //#define CFG_MMC_BASE //#define CFG_MMC_BASE 1 1 0xff000000 0xf0000000 bootcmd setting #elif defined(CONFIG_BOOT_MOVINAND) #define CFG_ENV_IS_IN_MOVINAND #define CONFIG_BOOTCOMMAND "movi read zImage c0008000;bootm c0008000"
  • 21. movi.h Bootloaderu-bootincludemovi.h #if defined(CONFIG_S3C2450) || defined(CONFIG_S3C2416) #define HSMMC_CHANNEL 1 Define HSMMC_CHANNEL #else #define HSMMC_CHANNEL 1 //0-->TF 1--> SD #endif /* offset information */ #define PART_UBOOT_OFFSET #define PART_ZIMAGE_OFFSET #define PART_ROOTFS_OFFSET #define PART_EXTRA_OFFSET /* movinand definitions */ #define MOVI_BLKSIZE 0x0 0x40000 0x440000 0x3200000 512 Offset in movinand (SD card) **refer page 16 Block size definition 1 block = 512 bytes
  • 22. movi.h (cont.) Bootloaderu-bootincludemovi.h #define #define #define #define MOVI_LAST_BLKPOS MOVI_BL1_BLKCNT MOVI_ENV_BLKCNT MOVI_BL2_BLKCNT #define MOVI_ZIMAGE_BLKCNT #define MOVI_BL2_POS #define MOVI_ROOTFS_BLKCNT (MOVI_TOTAL_BLKCNT - (eFUSE_SIZE / MOVI_BLKSIZE)) (SS_SIZE / MOVI_BLKSIZE) (CFG_ENV_SIZE / MOVI_BLKSIZE) (((PART_ZIMAGE_OFFSET - PART_UBOOT_OFFSET) / MOVI_BLKSIZE) - MOVI_ENV_BLKCNT) ((PART_ROOTFS_OFFSET - PART_ZIMAGE_OFFSET) / MOVI_BLKSIZE) (MOVI_LAST_BLKPOS - MOVI_BL1_BLKCNT – MOVI_BL2_BLKCNT - MOVI_ENV_BLKCNT) 8 * 1024 * 1024 / MOVI_BLKSIZE //(PART_SIZE_ROOTFS / MOVI_BLKSIZE) According to the formulas above, we can easily calculate the exact position of each segment. (you can check the following excel file to get more detailed information.) **refer page 16
  • 23. hs_mmc.c Bootloaderu-bootcpus3c64xxhs_mmc.c int hsmmc_init (void) { u32 reg; uint width; issue_command(MMC_GO_IDLE_STATE, 0x00, 0, 0); issue_command(MMC_SEND_EXT_CSD, 0x000001AA, 0, MMC_RSP_R1); Add this statement to initial SDHC /* MMC_SET_BLOCKLEN */ while (!issue_command(MMC_SET_BLOCKLEN, 512, 0, MMC_RSP_R1)); s3c_hsmmc_writew(0xffff, HM_NORINTSTS); return 0; }
  • 29. Environment Setting - bootcmd setenv bootcmd “movi read zImage c0008000;bootm c0008000” **refer page 21
  • 31. Environment Setting - bootargs setenv bootargs “root=/dev/mmcblk0p2 rootfstype=ext3 rootdelay=3 init=/linuxrc console=ttySAC0,115200” **set bootargs at smdk6410.h
  • 32. Screenshot Note: The root file system is pre-built in SD card.
  • 34. Fusing Tool To fuse the boot loader (u-boot.bin), kernel (zImage), and file system (rootfs.tar) to SD card automatically. sdcard=$1 if [ "$sdcard" = "" ];then echo " # Usage - ./sd.sh /dev/SDcardDevicename (ex. sd.sh /dev/sdc)" echo " # prepare the necessary files(zImage,rootfs.tar,uboot.bin rootfs.tar is a tar.bz2 file)" echo " # and verify that the device is correct" exit 0 . mkdir /mnt1 mount ${sdcard}2 /mnt1 tar -jxvf rootfs.tar -C /mnt1 cp -rap /mnt/rootfs/* /mnt1 umount /mnt1 rm -rf /mnt1
  • 35. How to use the fusing tool root@Linux:~# ./sd4.sh /dev/sdc 1. Run the shell script “sd4.sh” as root. 2. Assign the block device where the SD card exists (ex. /dev/sdc). 3. The root file system has to be packed as rootfs.tar before running this shell script. 4. The boot loader (u-boot.bin), kernel (zImage) and the file system (rootfs.tar) must exist in the same folder. 5. The name of the files u-boot.bin, zImage, and rootfs.tar are fixed, casesensitive.
  • 36. How the shell script works step command 1. Check the device user enters exists and make sure it is an SD card. 2. Partition the device (two partitions will be made). fdisk 3. Format the second partition as ext3. mkfs.ext3 4. Fuse the first 8k of u-boot.bin to the BL1 area of the SD card. dd 5. Fuse the u-boot.bin to the BL2 area of he SD card. (u-boot.bin has to be smaller than 256KB) dd 6. Fuse the zImage to the kernel area of he SD card. dd 7. Make a directory named /mnt1 as the mount point mkdir 8. Mount the second partition (ext3) to the mount point (/mnt1). mount 9. Extract rootfs.tar to /mnt1 Tar 10. Un-mount the mount point (/mnt1) umount 11. Delete the mount point (/mnt1) rm
  • 38. Member Introduction Name Education Background Tasks of the project Working Experience Vincent Chen (Team Leader) Lan Yang Institute of Technology BS. Electronics Engineering - Kernel implement: - MTD support - MMC/SD card support - Kernel logo display - R&D Engineer (Electric Meters) - Field Application Engineer Annie Cheng Ming Hsin University of Science and Technology BS. In Electronic Engineering - Hardware layout tracing for SD/SDHC boot - Documentation - Senior Validation Engineer (CPU Electrical / Margining) - System Validation Test Engineer YiChin Huang Chih Lee Institute of Technology BS. in Information Management - U-boot support SDHC implement - SD card fusing tool implement Jason Kung Texas A&M University - Commerce MS. In Computer Science MS. In Management - U-boot support SD implement - Kernel, File System (ext3, readable/writable)on SD - Field Application Engineer (ARM Application Processor) - Product Manager (ARM Application Processor)