diff mbox

[V2,3/4] A20-OLinuXino-Lime: new board (mainline)

Message ID 1434741204-3988-4-git-send-email-francois.perrad@gadz.org
State Superseded
Headers show

Commit Message

Francois Perrad June 19, 2015, 7:13 p.m. UTC
config device tree / mainline (4.0.5)

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 board/olimex/a20_olinuxino_lime/boot.cmd      |  5 ++
 board/olimex/a20_olinuxino_lime/post-build.sh |  8 +++
 board/olimex/a20_olinuxino_lime/readme.txt    | 86 +++++++++++++++++++++++++++
 configs/olimex_a20_olinuxino_defconfig        | 41 +++++++++++++
 4 files changed, 140 insertions(+)
 create mode 100644 board/olimex/a20_olinuxino_lime/boot.cmd
 create mode 100755 board/olimex/a20_olinuxino_lime/post-build.sh
 create mode 100644 board/olimex/a20_olinuxino_lime/readme.txt
 create mode 100644 configs/olimex_a20_olinuxino_defconfig

Comments

Arnout Vandecappelle June 19, 2015, 8:49 p.m. UTC | #1
On 06/19/15 21:13, Francois Perrad wrote:
> config device tree / mainline (4.0.5)
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

 Just some minor documentation fixes... With that:

  Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

[snip]
> +How to build it
> +===============
> +
> +    $ make olimex_a20_olinuxino_defconfig
> +
> +Compile all and build rootfs image:

Compile everything and build the rootfs image:

> +
> +    $ make
> +
> +Result of the build
> +-------------------
> +
> +After building, you should get a tree like this:
> +
> +    output/images/
> +    +-- rootfs.ext2
> +    +-- rootfs.ext4 -> rootfs.ext2
> +    +-- sun7i-a20-olinuxino-lime.dtb
> +    +-- u-boot.bin
> +    +-- u-boot-sunxi-with-spl.bin
> +    `-- zImage
> +
> +
> +How setting up the SD card

How to write the SD card

> +==========================
> +
> +
> +Prepare the SD card
> +-------------------
> +
> +Erase existing stuff, and create an unique Linux partition with `fdisk`.
> +
> +    # fdisk /dev/sdX
> +    Command (m for help): o
> +    Building a new DOS disklabel with disk identifier 0xf9e1616a.
> +    Changes will remain in memory only, until you decide to write them.
> +    After that, of course, the previous content won't be recoverable.
> +
> +    Command (m for help): n
> +    Partition type:
> +        p   primary (0 primary, 0 extended, 4 free)
> +        e   extended
> +    Select (default p): p
> +    Partition number (1-4, default 1): 1
> +    First sector (2048-7626751, default 2048): 2048
> +    Last sector, +sectors or +size{K,M,G} (2048-7626751, default 7626751): 
> +    Using default value 7626751
> +
> +    Command (m for help): p
> +
> +    Disk /dev/sdX: 3904 MB, 3904897024 bytes
> +    4 heads, 16 sectors/track, 119168 cylinders, total 7626752 sectors
> +    Units = sectors of 1 * 512 = 512 bytes
> +    Sector size (logical/physical): 512 bytes / 512 bytes
> +    I/O size (minimum/optimal): 512 bytes / 512 bytes
> +    Disk identifier: 0xf9e1616a
> +
> +            Device Boot      Start         End      Blocks   Id  System
> +    /dev/sdX1                 2048     7626751     3812352   83  Linux
> +
> +    Command (m for help): w
> +    The partition table has been altered!
> +
> +    Calling ioctl() to re-read partition table.
> +    Syncing disks.
> +
> +Copy images on the SD card
> +--------------------------
> +
> +    # dd if=output/images/rootfs.ext2 of=/dev/sdX1

 rootfs.ext4

 Also, I personally prefer to use cat rather than dd, it's generally faster.

> +    # dd if=output/images/u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
> +
> +
> +Finish
> +======
> +
> +Eject the SD card, insert it in the A20-OLinuXino-LIME board, and power it up.
> +
> diff --git a/configs/olimex_a20_olinuxino_defconfig b/configs/olimex_a20_olinuxino_defconfig
> new file mode 100644
> index 0000000..d59a2cc
> --- /dev/null
> +++ b/configs/olimex_a20_olinuxino_defconfig
> @@ -0,0 +1,41 @@
> +# Architecture
> +BR2_arm=y
> +BR2_cortex_a7=y
> +
> +# Kernel headers
> +BR2_KERNEL_HEADERS_4_0=y
> +
> +# System configuration
> +BR2_TARGET_GENERIC_HOSTNAME="a20-olinuxino"
> +BR2_TARGET_GENERIC_ISSUE="Welcome to use OLinuXino!"

 The 'use' is redundant here.


 Regards,
 Arnout

> +BR2_TARGET_GENERIC_GETTY=y
> +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
> +BR2_ROOTFS_POST_BUILD_SCRIPT="board/olimex/a20_olinuxino_lime/post-build.sh"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="board/olimex/a20_olinuxino_lime/boot.cmd $(TARGET_DIR)/boot"
[snip]
Luca Ceresoli June 22, 2015, 12:06 p.m. UTC | #2
Dear Francois,

Francois Perrad wrote:
> config device tree / mainline (4.0.5)
>
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>   board/olimex/a20_olinuxino_lime/boot.cmd      |  5 ++
>   board/olimex/a20_olinuxino_lime/post-build.sh |  8 +++
>   board/olimex/a20_olinuxino_lime/readme.txt    | 86 +++++++++++++++++++++++++++
>   configs/olimex_a20_olinuxino_defconfig        | 41 +++++++++++++

To differentiate it from the Lime2 and the Micro, the defconfig should
be named configs/olimex_a20_olinuxino_lime_defconfig
                                      ^^^^^

It's not just a nitpick. I'm working on a -Micro these days and I will
probably send a defconfig for it. The -Micro must pull a different
U-Boot config, so the Buildroot defconfig will be different as well.

On the other hand, I _suspect_ the files in
boards/olimex/a20_olinuxino_lime can be generalized with minimal effort
to encompass both boards. But I cannot confirm that right now.

[...]

> diff --git a/board/olimex/a20_olinuxino_lime/readme.txt b/board/olimex/a20_olinuxino_lime/readme.txt
> new file mode 100644
> index 0000000..cc661a6
> --- /dev/null
> +++ b/board/olimex/a20_olinuxino_lime/readme.txt
> @@ -0,0 +1,86 @@
> +A20-OLinuXino-LIME
> +
> +Intro
> +=====
> +
> +This is a open hardware board,
> +see https://www.olimex.com/Products/OLinuXino/open-source-hardware

Why not a link to the board page itself as well?
It's https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME/

I build-tested this patch, I should have a board in a few days and be
able to run-test it as well.

[Build test only]
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Luca Ceresoli June 22, 2015, 12:23 p.m. UTC | #3
Dear Arnout,

Arnout Vandecappelle wrote:
> On 06/19/15 21:13, Francois Perrad wrote:
>> config device tree / mainline (4.0.5)
>>
>> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>
>   Just some minor documentation fixes... With that:
>
>    Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Looks like your tag has not been picked up by patchwork (ART=0/0/1).
Maybe leading spaces are not taken into account?

[...]
>> +Copy images on the SD card
>> +--------------------------
>> +
>> +    # dd if=output/images/rootfs.ext2 of=/dev/sdX1
>
>   rootfs.ext4
>
>   Also, I personally prefer to use cat rather than dd, it's generally faster.

Interesting! I don't think there is any noticeable lag copying <7 MB to
an SD card... But since defconfigs are supposed to be used as a starting
point for real, and possibly large, projects, I'm fine with your
suggestion.
Yann E. MORIN June 22, 2015, 8:56 p.m. UTC | #4
Luca, Arnout, All,

On 2015-06-22 14:23 +0200, Luca Ceresoli spake thusly:
> Arnout Vandecappelle wrote:
> >On 06/19/15 21:13, Francois Perrad wrote:
> >>config device tree / mainline (4.0.5)
> >>
> >>Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> >
> >  Just some minor documentation fixes... With that:
> >
> >   Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 
> Looks like your tag has not been picked up by patchwork (ART=0/0/1).
> Maybe leading spaces are not taken into account?

Indeed, the tags must start in the first column to b recognised by
Patchwork.

Regards,
Yann E. MORIN.
Arnout Vandecappelle June 22, 2015, 9:22 p.m. UTC | #5
On 06/22/15 14:23, Luca Ceresoli wrote:
> Dear Arnout,
> 
> Arnout Vandecappelle wrote:
>> On 06/19/15 21:13, Francois Perrad wrote:
>>> config device tree / mainline (4.0.5)
>>>
>>> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>>
>>   Just some minor documentation fixes... With that:
>>
>>    Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 
> Looks like your tag has not been picked up by patchwork (ART=0/0/1).
> Maybe leading spaces are not taken into account?

 Indeed. That's intentional, because I didn't want to add the tag to the patch
as is, but I wanted to signal to Francois that he can add the tag after making
the requested changes.

 Regards,
 Arnout

[snip]
diff mbox

Patch

diff --git a/board/olimex/a20_olinuxino_lime/boot.cmd b/board/olimex/a20_olinuxino_lime/boot.cmd
new file mode 100644
index 0000000..1714f20
--- /dev/null
+++ b/board/olimex/a20_olinuxino_lime/boot.cmd
@@ -0,0 +1,5 @@ 
+setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait panic=10 ${extra}
+ext4load mmc 0 0x49000000 /boot/sun7i-a20-olinuxino-lime.dtb
+ext4load mmc 0 0x46000000 /boot/zImage
+env set fdt_high ffffffff
+bootz 0x46000000 - 0x49000000
diff --git a/board/olimex/a20_olinuxino_lime/post-build.sh b/board/olimex/a20_olinuxino_lime/post-build.sh
new file mode 100755
index 0000000..4e6fbec
--- /dev/null
+++ b/board/olimex/a20_olinuxino_lime/post-build.sh
@@ -0,0 +1,8 @@ 
+#!/bin/sh
+# args from BR2_ROOTFS_POST_SCRIPT_ARGS
+# $2    path of boot.cmd
+# $3    output directory for boot.scr
+
+MKIMAGE=$HOST_DIR/usr/bin/mkimage
+
+$MKIMAGE -A arm -O linux -T script -C none -d $2 $3/boot.scr
diff --git a/board/olimex/a20_olinuxino_lime/readme.txt b/board/olimex/a20_olinuxino_lime/readme.txt
new file mode 100644
index 0000000..cc661a6
--- /dev/null
+++ b/board/olimex/a20_olinuxino_lime/readme.txt
@@ -0,0 +1,86 @@ 
+A20-OLinuXino-LIME
+
+Intro
+=====
+
+This is a open hardware board,
+see https://www.olimex.com/Products/OLinuXino/open-source-hardware
+
+How to build it
+===============
+
+    $ make olimex_a20_olinuxino_defconfig
+
+Compile all and build rootfs image:
+
+    $ make
+
+Result of the build
+-------------------
+
+After building, you should get a tree like this:
+
+    output/images/
+    +-- rootfs.ext2
+    +-- rootfs.ext4 -> rootfs.ext2
+    +-- sun7i-a20-olinuxino-lime.dtb
+    +-- u-boot.bin
+    +-- u-boot-sunxi-with-spl.bin
+    `-- zImage
+
+
+How setting up the SD card
+==========================
+
+
+Prepare the SD card
+-------------------
+
+Erase existing stuff, and create an unique Linux partition with `fdisk`.
+
+    # fdisk /dev/sdX
+    Command (m for help): o
+    Building a new DOS disklabel with disk identifier 0xf9e1616a.
+    Changes will remain in memory only, until you decide to write them.
+    After that, of course, the previous content won't be recoverable.
+
+    Command (m for help): n
+    Partition type:
+        p   primary (0 primary, 0 extended, 4 free)
+        e   extended
+    Select (default p): p
+    Partition number (1-4, default 1): 1
+    First sector (2048-7626751, default 2048): 2048
+    Last sector, +sectors or +size{K,M,G} (2048-7626751, default 7626751): 
+    Using default value 7626751
+
+    Command (m for help): p
+
+    Disk /dev/sdX: 3904 MB, 3904897024 bytes
+    4 heads, 16 sectors/track, 119168 cylinders, total 7626752 sectors
+    Units = sectors of 1 * 512 = 512 bytes
+    Sector size (logical/physical): 512 bytes / 512 bytes
+    I/O size (minimum/optimal): 512 bytes / 512 bytes
+    Disk identifier: 0xf9e1616a
+
+            Device Boot      Start         End      Blocks   Id  System
+    /dev/sdX1                 2048     7626751     3812352   83  Linux
+
+    Command (m for help): w
+    The partition table has been altered!
+
+    Calling ioctl() to re-read partition table.
+    Syncing disks.
+
+Copy images on the SD card
+--------------------------
+
+    # dd if=output/images/rootfs.ext2 of=/dev/sdX1
+    # dd if=output/images/u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
+
+
+Finish
+======
+
+Eject the SD card, insert it in the A20-OLinuXino-LIME board, and power it up.
+
diff --git a/configs/olimex_a20_olinuxino_defconfig b/configs/olimex_a20_olinuxino_defconfig
new file mode 100644
index 0000000..d59a2cc
--- /dev/null
+++ b/configs/olimex_a20_olinuxino_defconfig
@@ -0,0 +1,41 @@ 
+# Architecture
+BR2_arm=y
+BR2_cortex_a7=y
+
+# Kernel headers
+BR2_KERNEL_HEADERS_4_0=y
+
+# System configuration
+BR2_TARGET_GENERIC_HOSTNAME="a20-olinuxino"
+BR2_TARGET_GENERIC_ISSUE="Welcome to use OLinuXino!"
+BR2_TARGET_GENERIC_GETTY=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/olimex/a20_olinuxino_lime/post-build.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="board/olimex/a20_olinuxino_lime/boot.cmd $(TARGET_DIR)/boot"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.0.5"
+BR2_LINUX_KERNEL_USE_DEFCONFIG=y
+BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
+BR2_LINUX_KERNEL_ZIMAGE=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun7i-a20-olinuxino-lime"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+
+# Filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+
+# Bootloaders
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_VERSION="2015.04"
+BR2_TARGET_UBOOT_BOARDNAME="A20-OLinuXino-Lime"
+BR2_TARGET_UBOOT_FORMAT_BIN=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
+
+# Additional tools
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y