bananapipro u-boot移植

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

BananaPro/Pi:Setting up the bootable SD card

From BananaPro/Pi

Jump to: navigation, search

Note: these instructions are for a Linux computer, not the Banana Pro/Pi!! Contents

[hide]

∙ 1 Introduction

∙ 2 SD Card Layout

∙ 3 Partitioning and formatting

∙ 4 Bootloader

∙ 5 Boot Script

∙ 6 Kernel

∙7 References

Introduction

This page describes how to create a bootable SD card. Depending on how the SD card is set up, the locations in which data is written can be different. Throughout this document ${card}refers to the SD card and ${p} to the partition, if there are any.

If the SD card is connected via a USB adapter, Linux will know it for example as/dev/sdX (X represents the letters b or c or d, etc.). Please note that this device might be different depending on various factors, so when you are not sure, use the fdisk command to check it.

If connected via an SD slot on a device, Linux will know it as /dev/mmcblk0 (or mmcblk1, mmcblk2, depending on which mmc slot is being used). (mmc stands for MultiMediaCard by the way!)

Data is either stored raw on the SD card or in a partition. If ${p} is used, then the appropriate partition should be written to. Also, this differs for USB adapters and mmc controllers. When using an USB adapter, ${p} will be 1, 2, 3 etc so the resulting device is /dev/sdX1. Using an

mmc controller, this would be p1, p2, p3 etc so the resulting device is /dev/mmcblk0p1.

To summarize, ${card} and ${card}${p}1 mean /dev/sdX and /dev/sdX1 on a USB connected SD card, and /dev/mmcblk0, /dev/mmcblk0p1 on an mmc controller connected device.

If the SD card is physically removed but then inserted into/connected to another slot or port of the PC, the device nodes can change again and be different, so be aware of this and take it into account.

It is assumed that you have already got files such as

u-boot-sunxi-with-spl.bin, uImage and script.bin. (See the previous section in this Wiki “1. Building u-boot, script.bin and linux-kernel” for how to do this.)

SD Card Layout

SD Card Layout

start size usage

0 8KB Unused, available for partition table etc.

8 24KB Initial SPL loader

32 512KB u-boot

544 128KB environment

672 352KB reserved

1024 - Free for partitions

Partitioning and formatting

First identify the device node of the card:

sudo fdisk -l

This will list all the storage devices connected to your PC.

Assuming the SD card is connected via USB and is sdb:

export card=/dev/sdb

export p=""

If the SD card is connected via mmc and is mmcblk0:

export card=/dev/mmcblk0

export p=p

First use the "umount" command (notice the different spelling without the 'n') to unmount all the partitions, and then use the "fdisk" command to partition the SD card:

sudo fdisk ${card}

Use the command o to delete all partitions, and then use command n to add new partitions.

Add the first partition

Command (m for help): n # Type n Partition type:

p primary (0 primary, 0 extended, 4 free)

e extended

Select (default p): # Press Enter Key

Using default response p

Partition number (1-4, default 1): # Press Enter Key

Using default value 1

First sector (2048-15523839, default 2048): # Press Enter Key

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-15523839, default 15523839): +20M # Type +20M

相关文档
最新文档