[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Support for sunxi-based ARM systems in d-i



Hello,

I am currently working on better support for sunxi-based ARM systems
in d-i and flash-kernel.  Thanks to Ian's backport of the sunxi AHCI
support from kernel 3.15rc1 into the Debian 3.14 kernel package (as
of linux-image-3.14-trunk-armmp_3.14.1-1~exp2_armhf.deb, currently
only available as source in git) it is now possible to run d-i on
Allwinner A10/A20-based systems like the Cubie{board,board2,truck}.

I have installed Jessie on a Cubietruck today with a local build
of d-i and the installation works mostly ok. Open points are:

- A few missing kernel drivers (RTC, USB, MMC)

  I have filed a wishlist bug (#745972) against the linux package
  to have the missing drivers enabled in future releases.

- Missing flash-kernel support for the Cubietruck to make the
  system bootable.

- No bootable uImages suitable for sunxi devices are generated
  by the d-i build scripts.

I have been working on the last two points and would like to ask
whether there are any objections against committing the following
patches to the flash-kernel and installer repositories.

Flash-Kernel:
=============

diff --git a/bootscript/bootscr.sunxi b/bootscript/bootscr.sunxi
new file mode 100644
index 0000000..8db24e1
--- /dev/null
+++ b/bootscript/bootscr.sunxi
@@ -0,0 +1,6 @@
+ext4load ${device} ${partition} 0x46000000 /boot/uImage || ext4load ${device} ${partition} 0x46000000 uImage || ext2load ${device} ${partition} 0x46000000 boot/uImage || ext2load ${device} ${partition} 0x46000000 uImage
+ext4load ${device} ${partition} 0x47000000 /boot/dtb || ext4load ${device} ${partition} 0x47000000 dtb || ext2load ${device} ${partition} 0x47000000 /boot/dtb || ext2load ${device} ${partition} 0x47000000 dtb
+ext4load ${device} ${partition} 0x48000000 /boot/uInitrd || ext4load ${device} ${partition} 0x48000000 uInitrd || ext2load ${device} ${partition} 0x48000000 /boot/uInitrd || ext2load ${device} ${partition} 0x48000000 uInitrd
+setenv fdt_high ffffffff
+setenv initrd_high 0xffffffff
+bootm 0x46000000 0x48000000 0x47000000
diff --git a/db/all.db b/db/all.db
index 93fa714..afcc8fb 100644
--- a/db/all.db
+++ b/db/all.db
@@ -64,6 +64,19 @@ Boot-Initrd-Path: /boot/initrd.buffalo
 Required-Packages: u-boot-tools
 Bootloader-Sets-Incorrect-Root: yes
 
+Machine: Cubietech Cubietruck
+Kernel-Flavors: armmp
+U-Boot-Kernel-Address: 0x40008000
+U-Boot-Initrd-Address: 0x0
+Boot-Kernel-Path: /boot/uImage
+Boot-Initrd-Path: /boot/uInitrd
+Boot-Script-Path: /boot/boot.scr
+Boot-DTB-Path: /boot/dtb
+DTB-Id: sun7i-a20-cubietruck.dtb
+U-Boot-Script-Name: bootscr.sunxi
+Required-Packages: u-boot-tools
+Bootloader-Sets-Incorrect-Root: no
+
 Machine: D-Link DNS-323
 Kernel-Flavors: orion5x
 Machine-Id: 1542

The bootscr.sunxi is written for and tested to work with u-boot-sunxi,
as getting sunxi support into the mainline u-boot codebase is still
work in progress.  I'll run tests with mainline u-boot as soon as
the sunxi patches have been accepted upstream.


Installer:
==========

diff --git a/build/config/armhf/netboot.cfg b/build/config/armhf/netboot.cfg
index e6886ba..10bb9e0 100644
--- a/build/config/armhf/netboot.cfg
+++ b/build/config/armhf/netboot.cfg
@@ -1,6 +1,6 @@
 MEDIA_TYPE = netboot image
 
-TARGET = $(INITRD) $(KERNEL) efikamx
+TARGET = $(INITRD) $(KERNEL) efikamx sunxi
 EXTRANAME = $(MEDIUM)/
 
 MANIFEST-INITRD = "netboot initrd"
@@ -16,3 +16,10 @@ efikamx:
 	update-manifest $(SOME_DEST)/$(EXTRANAME)/efikamx/uImage "Linux kernel for Efika MX"
 	update-manifest $(SOME_DEST)/$(EXTRANAME)/efikamx/uInitrd "initrd for Efika MX"
 	update-manifest $(SOME_DEST)/$(EXTRANAME)/efikamx/boot.scr "U-Boot Script for Efika MX"
+
+sunxi:
+	mkdir -p $(SOME_DEST)/$(EXTRANAME)/sunxi
+	mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n "Debian kernel" -d $(KERNEL) $(SOME_DEST)/$(EXTRANAME)/sunxi/uImage
+	mkimage -A arm -O linux -T ramdisk -C gzip -n "Debian-Installer ramdisk" -d $(INITRD) $(SOME_DEST)/$(EXTRANAME)/sunxi/uInitrd
+	update-manifest $(SOME_DEST)/$(EXTRANAME)/sunxi/uImage "Linux kernel for Allwinner SunXi based systems"
+	update-manifest $(SOME_DEST)/$(EXTRANAME)/sunxi/uInitrd "initrd for Allwinner SunXi based systems"

This generates uImage/uInitrd with a proper load address for booting
on sunxi-based systems.

Regards,
Karsten 
-- 
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.


Reply to: