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

Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
 
[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階Simen Li
 
Alphorm.com formation-GNS3
Alphorm.com formation-GNS3Alphorm.com formation-GNS3
Alphorm.com formation-GNS3Alphorm
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Distributed Compiler Icecc
Distributed Compiler IceccDistributed Compiler Icecc
Distributed Compiler IceccSZ Lin
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingViller Hsiao
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareBrendan Gregg
 
Mise En Place d'une Solution de Supervision Réseau
Mise En Place d'une Solution de Supervision Réseau Mise En Place d'une Solution de Supervision Réseau
Mise En Place d'une Solution de Supervision Réseau Yaya N'Tyeni Sanogo
 
Linux Interrupts
Linux InterruptsLinux Interrupts
Linux InterruptsKernel TLV
 
Allegro PCB教學
Allegro PCB教學Allegro PCB教學
Allegro PCB教學Michael Lee
 
Bottom half in linux kernel
Bottom half in linux kernelBottom half in linux kernel
Bottom half in linux kernelKrishnaPrasad630
 
Differents bus terrain
Differents bus terrainDifferents bus terrain
Differents bus terrainImed Frioukh
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver艾鍗科技
 
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言Simen Li
 
Linux kernel tracing
Linux kernel tracingLinux kernel tracing
Linux kernel tracingViller Hsiao
 
Rapport fin de cours toip
Rapport fin de cours toip Rapport fin de cours toip
Rapport fin de cours toip assane fall
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceSUSE Labs Taipei
 
Le montage d'un ordinateur
Le montage d'un ordinateurLe montage d'un ordinateur
Le montage d'un ordinateurD1clic
 

Mais procurados (20)

Informatique
InformatiqueInformatique
Informatique
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階[嵌入式系統] 嵌入式系統進階
[嵌入式系統] 嵌入式系統進階
 
Alphorm.com formation-GNS3
Alphorm.com formation-GNS3Alphorm.com formation-GNS3
Alphorm.com formation-GNS3
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Distributed Compiler Icecc
Distributed Compiler IceccDistributed Compiler Icecc
Distributed Compiler Icecc
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
 
Mise En Place d'une Solution de Supervision Réseau
Mise En Place d'une Solution de Supervision Réseau Mise En Place d'une Solution de Supervision Réseau
Mise En Place d'une Solution de Supervision Réseau
 
Linux Interrupts
Linux InterruptsLinux Interrupts
Linux Interrupts
 
Allegro PCB教學
Allegro PCB教學Allegro PCB教學
Allegro PCB教學
 
Bottom half in linux kernel
Bottom half in linux kernelBottom half in linux kernel
Bottom half in linux kernel
 
Differents bus terrain
Differents bus terrainDifferents bus terrain
Differents bus terrain
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver
 
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言
 
Linux kernel tracing
Linux kernel tracingLinux kernel tracing
Linux kernel tracing
 
Rapport fin de cours toip
Rapport fin de cours toip Rapport fin de cours toip
Rapport fin de cours toip
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace
 
Le montage d'un ordinateur
Le montage d'un ordinateurLe montage d'un ordinateur
Le montage d'un ordinateur
 

Semelhante a Build Embedded System on 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
 
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 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
 
eMMC Embedded Multimedia Card overview
eMMC Embedded Multimedia Card overvieweMMC Embedded Multimedia Card overview
eMMC Embedded Multimedia Card overviewVijayGESYS
 
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
 

Semelhante a Build Embedded System on 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
 
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 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
 
eMMC Embedded Multimedia Card overview
eMMC Embedded Multimedia Card overvieweMMC Embedded Multimedia Card overview
eMMC Embedded Multimedia Card overview
 
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
 

Mais de 艾鍗科技

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艾鍗科技
 
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)

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
 
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

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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...
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Build Embedded System on 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)