diff mbox series

board/cubietech/cubieboard1: add Cubieboard 1

Message ID 20221105194712.541286-1-gero@schwaericke.email
State Changes Requested
Headers show
Series board/cubietech/cubieboard1: add Cubieboard 1 | expand

Commit Message

Gero Schwäricke Nov. 5, 2022, 7:47 p.m. UTC
Board support for the Cubieboard 1 from Cubietech. Based the config for
Cubieboard 2 and the Olimex A10-OLinuXino-LIME which is also an
Allwinner A10 board (sunxi kernel).

Signed-off-by: Gero Schwäricke <gero@schwaericke.email>
---
 board/cubietech/cubieboard1/boot.cmd     |  7 +++++
 board/cubietech/cubieboard1/genimage.cfg | 36 ++++++++++++++++++++++
 configs/cubieboard1_defconfig            | 39 ++++++++++++++++++++++++
 3 files changed, 82 insertions(+)
 create mode 100644 board/cubietech/cubieboard1/boot.cmd
 create mode 100644 board/cubietech/cubieboard1/genimage.cfg
 create mode 100644 configs/cubieboard1_defconfig

Comments

Thomas Petazzoni Feb. 17, 2023, 3:15 p.m. UTC | #1
Hello Gero,

On Sat,  5 Nov 2022 19:47:12 +0000
Gero Schwäricke <gero@schwaericke.email> wrote:

> Board support for the Cubieboard 1 from Cubietech. Based the config for
> Cubieboard 2 and the Olimex A10-OLinuXino-LIME which is also an
> Allwinner A10 board (sunxi kernel).
> 
> Signed-off-by: Gero Schwäricke <gero@schwaericke.email>

First of all, thanks a lot for your contribution, and sorry for the
very slow feedback. See below some feedback.

First of all, the commit title should be:

	configs/cubieboard1: new defconfig

> ---
>  board/cubietech/cubieboard1/boot.cmd     |  7 +++++
>  board/cubietech/cubieboard1/genimage.cfg | 36 ++++++++++++++++++++++
>  configs/cubieboard1_defconfig            | 39 ++++++++++++++++++++++++
>  3 files changed, 82 insertions(+)
>  create mode 100644 board/cubietech/cubieboard1/boot.cmd
>  create mode 100644 board/cubietech/cubieboard1/genimage.cfg
>  create mode 100644 configs/cubieboard1_defconfig

Could you add an entry in the DEVELOPERS file, both for the
board/cubietech/cubieboard1/ folder and for the
configs/cubieboard1_defconfig file?

Another thing that is missing is a
board/cubietech/cubieboard1/readme.txt that explains how to use this
defconfig on this particular board.

> diff --git a/board/cubietech/cubieboard1/boot.cmd b/board/cubietech/cubieboard1/boot.cmd
> new file mode 100644
> index 0000000000..eefbdc8169
> --- /dev/null
> +++ b/board/cubietech/cubieboard1/boot.cmd
> @@ -0,0 +1,7 @@
> +# based on board/cubieboard2/boot.cmd
> +
> +setenv fdt_high ffffffff
> +setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
> +fatload mmc 0 $kernel_addr_r zImage
> +fatload mmc 0 $fdt_addr_r sun4i-a10-cubieboard.dtb
> +bootz $kernel_addr_r - $fdt_addr_r

There's no support for extlinux.conf in the default U-Boot
configuration for this board?

Otherwise, it all looks good to me. Could you address the minor issues
listed here, and send a 2nd version of your patch?

Thanks a lot!

Thomas Petazzoni
Gero Schwäricke Aug. 9, 2023, 6:16 p.m. UTC | #2
Hi Thomas,

sorry for the (very) late response. Thank you very much for the review! 
I'm working on v2 of my patch now.

On 17.02.23 16:15, Thomas Petazzoni wrote:
>> diff --git a/board/cubietech/cubieboard1/boot.cmd b/board/cubietech/cubieboard1/boot.cmd
>> new file mode 100644
>> index 0000000000..eefbdc8169
>> --- /dev/null
>> +++ b/board/cubietech/cubieboard1/boot.cmd
>> @@ -0,0 +1,7 @@
>> +# based on board/cubieboard2/boot.cmd
>> +
>> +setenv fdt_high ffffffff
>> +setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
>> +fatload mmc 0 $kernel_addr_r zImage
>> +fatload mmc 0 $fdt_addr_r sun4i-a10-cubieboard.dtb
>> +bootz $kernel_addr_r - $fdt_addr_r
> 
> There's no support for extlinux.conf in the default U-Boot
> configuration for this board?

I didn't even know u-boot could do that, thank you! :)

Best,
Gero
diff mbox series

Patch

diff --git a/board/cubietech/cubieboard1/boot.cmd b/board/cubietech/cubieboard1/boot.cmd
new file mode 100644
index 0000000000..eefbdc8169
--- /dev/null
+++ b/board/cubietech/cubieboard1/boot.cmd
@@ -0,0 +1,7 @@ 
+# based on board/cubieboard2/boot.cmd
+
+setenv fdt_high ffffffff
+setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
+fatload mmc 0 $kernel_addr_r zImage
+fatload mmc 0 $fdt_addr_r sun4i-a10-cubieboard.dtb
+bootz $kernel_addr_r - $fdt_addr_r
diff --git a/board/cubietech/cubieboard1/genimage.cfg b/board/cubietech/cubieboard1/genimage.cfg
new file mode 100644
index 0000000000..2ed4dde951
--- /dev/null
+++ b/board/cubietech/cubieboard1/genimage.cfg
@@ -0,0 +1,36 @@ 
+# based on board/cubieboard2/genimage.cfg
+
+image boot.vfat {
+	vfat {
+		files = {
+			"zImage",
+			"sun4i-a10-cubieboard.dtb",
+			"boot.scr"
+		}
+	}
+
+	size = 16M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot-sunxi-with-spl.bin"
+		offset = 8K
+		size = 1016K # 1MB - 8KB
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+	}
+}
diff --git a/configs/cubieboard1_defconfig b/configs/cubieboard1_defconfig
new file mode 100644
index 0000000000..601d4ab38c
--- /dev/null
+++ b/configs/cubieboard1_defconfig
@@ -0,0 +1,39 @@ 
+# Architecture
+BR2_arm=y
+BR2_cortex_a8=y
+
+# Toolchain options
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_0=y
+
+# Bootloader
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.04"
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="Cubieboard"
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/cubietech/cubieboard1/boot.cmd"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.0.1"
+BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun4i-a10-cubieboard"
+
+# Filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/cubietech/cubieboard1/genimage.cfg"
+
+# Host Requirements
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_MTOOLS=y