Skip to contentSkip to conversation

Add defconfig for MIPS Creator ci40

PATCH Superseded Abhimanyu Vishwakarma 2 participants 7 messages Apr 4, 2017 – Apr 5, 2017

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 Add defconfig for MIPS Creator ci40

From: Abhimanyu Vishwakarma <[email protected]>

Add post-image script to generate sdcard.img for
preparing sdcard/usb device.

---
Changes v1->v2
- No change
Changes v2->v3 (Suggested by Arnout)
- Remove uImage and add fitImage generation
- Tidy readme.txt
- Tidy ci40_defconfig, remove custom toolchain and add wifi helper packages Some changes are not done:
- Using git-helper:
- Custom kernel doesnt provide tar file, so it didnt work for me
Changes v3->v4 (Suggested by Arnout)
- Use github helper for getting kernel/u-boot
- rename fitImage.its -> fitImage.its.in to reflect as template file, remove hardcoded dtb filename
- Find dtb file in output/images directory and use first dtb in fitImage
- Remove image size from genimage.cfg
- Tidy readme.txt and add section to explain how to stop u-boot autoboot, how to make it persistent, and other grammar
Changes v4->v5 (Suggested by Thomas)
- Use fixed kernel entry addr
- Generate vmlinux.bin.gz from generate vmlinux.bin
- Remove generating uImage (not required for anything now)
Changes v5->v6
- Use kernel generate fitimage
- bump up u-boot version
- Change emailid from imgtec.com -> personal id

 board/ci40/genimage.cfg  | 12 +++++++++
 board/ci40/post-build.sh |  6 +++++
 board/ci40/post-image.sh | 15 +++++++++++
 board/ci40/readme.txt    | 70 ++++++++++++++++++++++++++++++++++++++++++++++++
 configs/ci40_defconfig   | 49 +++++++++++++++++++++++++++++++++
 5 files changed, 152 insertions(+)
 create mode 100644 board/ci40/genimage.cfg
 create mode 100755 board/ci40/post-build.sh
 create mode 100755 board/ci40/post-image.sh
 create mode 100644 board/ci40/readme.txt
 create mode 100644 configs/ci40_defconfig
board/ci40/genimage.cfg new file +12 -0
new file mode 100644
index 0000000..0ffc91c
@@ -0,0 +1,12 @@
+# Minimal SD card image
+#
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext4"
+  }
+}
board/ci40/post-build.sh new file +6 -0
new file mode 100755
index 0000000..0cd06b7
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+FITIMAGE=$BINARIES_DIR/vmlinux.gz.itb
+
+# Copy to target
+cp -a $FITIMAGE $TARGET_DIR/fitImage
board/ci40/post-image.sh new file +15 -0
new file mode 100755
index 0000000..18e76aa
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+  --rootpath "${TARGET_DIR}" \
+  --tmppath "${GENIMAGE_TMP}" \
+  --inputpath "${BINARIES_DIR}" \
+  --outputpath "${BINARIES_DIR}" \
+  --config "${GENIMAGE_CFG}"
+
board/ci40/readme.txt new file +70 -0

70 lines not on this page · raw message

configs/ci40_defconfig new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH v6 1/1 Add defconfig for MIPS Creator ci40

Hello,

Quoted 6 lines · Abhimanyu Vishwakarma

From: Abhimanyu Vishwakarma <[email protected]>

Add post-image script to generate sdcard.img for
preparing sdcard/usb device.

Thanks for this new version. It looks a lot better, but unfortunately, there are still a few things that are not good. Mainly because you're trying to make things too complicated. See below.

board/ci40/post-build.sh line 6

Quoted 12 lines
board/ci40/post-build.sh new file +6 -0
new file mode 100755
index 0000000..0cd06b7
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+FITIMAGE=$BINARIES_DIR/vmlinux.gz.itb
+
+# Copy to target
+cp -a $FITIMAGE $TARGET_DIR/fitImage

Just:

cp ${BINARIES_DIR}/vmlinux.gz.itb ${TARGET_DIR}/fitImage

Quoted 10 lines
board/ci40/post-image.sh new file +4 -0
new file mode 100755
index 0000000..18e76aa
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"

board/ci40/post-image.sh line 14

Quoted 10 lines
board/ci40/post-image.sh new file +10 -0
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+  --rootpath "${TARGET_DIR}" \
+  --tmppath "${GENIMAGE_TMP}" \
+  --inputpath "${BINARIES_DIR}" \
+  --outputpath "${BINARIES_DIR}" \
+  --config "${GENIMAGE_CFG}"

Please use support/scripts/genimage.sh.

board/ci40/readme.txt line 7

Quoted 13 lines
board/ci40/readme.txt new file +7 -0
new file mode 100644
index 0000000..2fde2b8
@@ -0,0 +1,70 @@
+*********************
+* MIPS Creator CI40 *
+*********************
+
+The 'ci40_defconfig' will create a root filesystem and a fitImage
+under the 'output/images/' directory. This document explains how
+to use them in order to run Buildroot in the MIPS Creator CI40 board.

I think this introduction is not really useful. What about instead:

This document details how to build and run a Buildroot system on the MIPS Creator CI40 platform. For more details about the CI40, see
https://creatordev.io/ci40-iot-hub.html.

How to build
------------

 $ make ci40_defconfig
 $ make

board/ci40/readme.txt line 17

Quoted 9 lines
board/ci40/readme.txt new file +9 -0
+Prepare USB/MMC for boot
+------------------------
+It can be done 2 ways:
+
+1. Using "sdcard.img" file created in output/images folder
+
+Use following command to write image to bootable device
+
+# dd if=./output/images/sdcard.img of=/dev/<your-microsd-or-usb-device>

Document only this method. We don't care about the next method since you're now generating a complete SD card/USB image.

board/ci40/readme.txt line 18

Quoted 2 lines
board/ci40/readme.txt new file +2 -0
+Booting from USB/MMC
+--------------------

Please add an empty line after each title.

board/ci40/readme.txt line 29

Quoted 4 lines
board/ci40/readme.txt new file +4 -0
+The boot loader is already present in NOR flash. To boot your newly generated
+Linux and root filesystem, you need to interrupt U-Boot autoboot. Current U-Boot
+is configured with 2 seconds of boot-delay, after expiry of this boot-delay
+timeout U-Boot start booting default image. To interrupt autoboot, press any

start -> starts

"booting default image" -> "booting the default image"

board/ci40/readme.txt line 30

Quoted 1 line
board/ci40/readme.txt new file +1 -0
+key before the boot-delay time expires, U-Boot will stops the autoboot process

stops -> stop

board/ci40/readme.txt line 31

Quoted 1 line
board/ci40/readme.txt new file +1 -0
+and gives a U-Boot prompt. You can now boot to your preferred boot method as

gives -> give

board/ci40/readme.txt line 41

Quoted 10 lines
board/ci40/readme.txt new file +10 -0
+describe below:
+
+From USB
+  pistachio # run usbboot
+
+From SD-Card
+  pistachio # run mmcboot
+
+Booting from network (nfsboot)
+------------------------------

Remove this section, we don't document network booting in readme.txt files in general.

Quoted 8 lines
board/ci40/readme.txt new file +8 -0
+Prepare nfs root (See Buildroot manual) and extract rootfs.tar file into it.
+
+  pistachio # setenv serverip <server-ip-address>
+  pistachio # setenv rootpath <nfs root path>
+  pistachio # run netboot
+
+Persistent boot command
+-----------------------

board/ci40/readme.txt

Quoted 10 lines
board/ci40/readme.txt new file +10 -0
+To boot automatically to your preferred boot method, use following command to
+make it persistent, for example to automatically boot to usb:
+
+  pistachio # setenv bootcmd run usbboot
+  pistachio # saveenv
+
+Flash new bootloader
+--------------------
+After booting with above method. Copy file u-boot-pistachio_marduk-2015.10-v1.0.4.img
+to /tmp.

Where is the u-boot-pistachio_marduk-2015.10-v1.0.4.img file? Why do you need to copy it specifically to /tmp?

board/ci40/readme.txt line 70

Quoted 12 lines

Use following command to flash new bootloader:

board/ci40/readme.txt new file +11 -0
+
+# flashcp -v /tmp/u-boot-pistachio_marduk-2015.10-v1.0.4.img /dev/mtd0
+
+Online docs
+-----------
+Mostly for OpenWRT but it is applicable to Buildroot
+https://docs.creatordev.io/ci40/guides/openwrt-platform/#overview
+
+Prebuilt uboot
+--------------
+http://downloads.creatordev.io/?q=u-boot/

Why would we document how to get a pre-built U-Boot if Buildroot is already building a working U-Boot ?

The rest looks good to me. Could you rework those last small details, and send an updated version?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH v6 1/1 Add defconfig for MIPS Creator ci40

Thankyou Thomas, for review!
I will prepare new patch and sent it over.

Quoted 10 lines · Thomas Petazzoni

Hello,

Quoted 6 lines · Abhimanyu Vishwakarma

From: Abhimanyu Vishwakarma <[email protected]>

Add post-image script to generate sdcard.img for
preparing sdcard/usb device.

<snip>

Quoted 10 lines

board/ci40/post-image.sh line 14

Quoted 6 lines
board/ci40/post-image.sh new file +6 -0
+genimage \
+  --rootpath "${TARGET_DIR}" \
+  --tmppath "${GENIMAGE_TMP}" \
+  --inputpath "${BINARIES_DIR}" \
+  --outputpath "${BINARIES_DIR}" \
+  --config "${GENIMAGE_CFG}"

Please use support/scripts/genimage.sh.

I have seen the patch but must have missed that it is already merged. i

will now use it.

<snip>

Quoted 10 lines

board/ci40/readme.txt

Quoted 3 lines
board/ci40/readme.txt new file +3 -0
+Flash new bootloader
+--------------------
+After booting with above method. Copy file u-boot-pistachio_marduk-2015.

10-v1.0.4.img

Quoted 1 line

+to /tmp.

Where is the u-boot-pistachio_marduk-2015.10-v1.0.4.img file? Why do you need to copy it specifically to /tmp?

It is just a step to copy to some temporary place to be able to flash the

new bootloader. I also need to update
bootloader version number here.

Quoted 7 lines
Quoted 7 lines

Use following command to flash new bootloader:

board/ci40/readme.txt new file +6 -0
+
+# flashcp -v /tmp/u-boot-pistachio_marduk-2015.10-v1.0.4.img /dev/mtd0
+
+Online docs
+-----------
+Mostly for OpenWRT but it is applicable to Buildroot
Quoted 9 lines

board/ci40/readme.txt line 70

Quoted 5 lines
board/ci40/readme.txt new file +5 -0
+https://docs.creatordev.io/ci40/guides/openwrt-platform/#overview
+
+Prebuilt uboot
+--------------
+http://downloads.creatordev.io/?q=u-boot/

Why would we document how to get a pre-built U-Boot if Buildroot is already building a working U-Boot ?

The rest looks good to me. Could you rework those last small details,

Quoted 10 lines

and send an updated version?

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Regards
Abhimanyu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170405/d57cdfd6/attachment.html>

#3 lore raw

PATCH v6 1/1 Add defconfig for MIPS Creator ci40

Hello,

Quoted 3 lines · abhimanyu.v at gmail.com

It is just a step to copy to some temporary place to be able to flash the new bootloader. I also need to update
bootloader version number here.

Why specifically in /tmp ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH v6 1/1 Add defconfig for MIPS Creator ci40

Quoted 10 lines · Thomas Petazzoni

Hello,

Quoted 3 lines · abhimanyu.v at gmail.com

It is just a step to copy to some temporary place to be able to flash the new bootloader. I also need to update
bootloader version number here.

Why specifically in /tmp ?

I think it was mostly from the point that /tmp are usually temporary mount and they are always writable. I dont think there is any reason other than that, user can download to any writable FS or use usb-drive.
I am trying to give some direction. Do you have suggestion to reword it?

Quoted 9 lines

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Regards
Abhimanyu V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170405/8b8c1882/attachment.html>

#5 lore raw

PATCH v6 1/1 Add defconfig for MIPS Creator ci40

Hello,

Quoted 4 lines · abhimanyu.v at gmail.com

I think it was mostly from the point that /tmp are usually temporary mount and they are always writable. I dont think there is any reason other than that, user can download to any writable FS or use usb-drive.
I am trying to give some direction. Do you have suggestion to reword it?

Ideally, the bootloader image should be part of the filesystem image, so it's easy for users to reflash their bootloader. But there's no easy way to do that.

So just say that there is a bootloader image in output/images/, and it can be used on the target to reflash the bootloader, and give the command line.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#6 lore raw

PATCH v6 1/1 Add defconfig for MIPS Creator ci40

Quoted 21 lines · Thomas Petazzoni

Hello,

Quoted 1 line · abhimanyu.v at gmail.com

I think it was mostly from the point that /tmp are usually temporary

mount

Quoted 3 lines

and they are always writable. I dont think there is any reason other than that, user can download to any writable FS or use usb-drive. I am trying to give some direction. Do you have suggestion to reword it?

Ideally, the bootloader image should be part of the filesystem image, so it's easy for users to reflash their bootloader. But there's no easy way to do that.

So just say that there is a bootloader image in output/images/, and it can be used on the target to reflash the bootloader, and give the command line.

Ok, looks good. Thankyou!

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Regards
Abhimanyu V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170405/97bc21f3/attachment.html>