diff --git a/board/businesscard/v1/dts/businesscard.dts b/board/businesscard/v1/dts/businesscard.dts new file mode 100644 index 0000000..36ddf3f --- /dev/null +++ b/board/businesscard/v1/dts/businesscard.dts @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR X11) +/* + * Copyright 2019 George Hilliard + */ + +/dts-v1/; +#include "suniv-f1c100s.dtsi" + +#include + +/ { + model = "George Hilliard's business card"; + compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s", + "allwinner,suniv"; + + aliases { + serial0 = &uart0; + spi0 = &spi0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins_a>; + status = "okay"; + flash: w25q64@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "winbond,w25q64", "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x80000>; + read-only; + }; + + partition@110000 { + label = "rootubi"; + reg = <0x80000 0x7800000>; + read-only; + }; + }; + }; +}; + +&otg_sram { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&usbphy { + usb0_id_det-gpio = <&pio 4 2 GPIO_ACTIVE_HIGH>; /* PE2 */ + status = "okay"; +}; diff --git a/board/businesscard/v1/genimage.cfg b/board/businesscard/v1/genimage.cfg new file mode 100644 index 0000000..b74deb2 --- /dev/null +++ b/board/businesscard/v1/genimage.cfg @@ -0,0 +1,32 @@ +flash w25q64 { + pebsize = 65536 + numpebs = 128 + minimum-io-unit-size = 512 + sub-page-size = 512 +} + +image flash.bin { + flash {} + flashtype = w25q64 + partition uboot { + image = "u-boot-sunxi-with-spl.bin" + size = 512K + } + partition rootubi { + image = root.ubi + size = 0 + } +} + +image root.ubi { + ubi {} + partition kernel { + image = "zImage" + } + partition dtb { + image = "businesscard.dtb" + } + partition root { + image = "rootfs.squashfs" + } +} diff --git a/board/businesscard/v1/uboot_defconfig b/board/businesscard/v1/uboot_defconfig index 30cdf3f..acfd0a7 100644 --- a/board/businesscard/v1/uboot_defconfig +++ b/board/businesscard/v1/uboot_defconfig @@ -8,27 +8,41 @@ CONFIG_MACH_SUNIV=y CONFIG_DRAM_CLK=156 CONFIG_DRAM_ZQ=0 # CONFIG_VIDEO_SUNXI is not set -CONFIG_DEFAULT_DEVICE_TREE="suniv-f1c100s-licheepi-nano" +CONFIG_DEFAULT_DEVICE_TREE="businesscard" CONFIG_SPL=y # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set CONFIG_SPL_MTD_SUPPORT=y # CONFIG_SPL_POWER_SUPPORT is not set CONFIG_SPL_RAM_SUPPORT=y CONFIG_SPL_RAM_DEVICE=y +# CONFIG_FASTBOOT is not set # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set CONFIG_CMD_SF=y CONFIG_CMD_SPI=y +CONFIG_MTDIDS_DEFAULT="nor0=spi-flash" +CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-flash:512k(uboot),-(rootubi)" +CONFIG_CMD_UBI=y +# CONFIG_CMD_UBIFS is not set +# CONFIG_ISO_PARTITION is not set CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_NET_RANDOM_ETHADDR=y # CONFIG_MMC is not set +CONFIG_MTD=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_BAR=y CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_WINBOND=y +# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set +CONFIG_SPI_FLASH_MTD=y CONFIG_SPL_SPI_SUNXI=y +CONFIG_MTD_UBI_FASTMAP=y # CONFIG_NETDEVICES is not set # CONFIG_SPL_DM_SERIAL is not set CONFIG_DM_SPI=y CONFIG_SUN6I_SPI=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_GADGET_DOWNLOAD=y +# CONFIG_USB_ETHER is not set diff --git a/configs/thirtythreeforty_businesscard_defconfig b/configs/thirtythreeforty_businesscard_defconfig index b50458f..1214d42 100644 --- a/configs/thirtythreeforty_businesscard_defconfig +++ b/configs/thirtythreeforty_businesscard_defconfig @@ -12,6 +12,8 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to Businesscard Linux!" BR2_TARGET_GENERIC_GETTY_PORT="/dev/ttyS0" BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BR2_EXTERNAL_BUSINESSCARD_PATH)/board/businesscard/v1/genimage.cfg" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/Lichee-Pi/linux.git" @@ -47,5 +49,8 @@ BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y # BR2_TARGET_UBOOT_FORMAT_BIN is not set BR2_TARGET_UBOOT_FORMAT_CUSTOM=y BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" +BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_BUSINESSCARD_PATH)/board/businesscard/v1/dts/*" +BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MKPASSWD=y +BR2_PACKAGE_HOST_MTD=y BR2_PACKAGE_HOST_SUNXI_TOOLS_F1C100S=y diff --git a/patches/uboot/0001-mtd-declare-MTD_PARTITIONS-symbol-in-Kconfig.patch b/patches/uboot/0001-mtd-declare-MTD_PARTITIONS-symbol-in-Kconfig.patch new file mode 100644 index 0000000..8a99386 --- /dev/null +++ b/patches/uboot/0001-mtd-declare-MTD_PARTITIONS-symbol-in-Kconfig.patch @@ -0,0 +1,33 @@ +From 4048a5c519a86eab2805f4f07fe9f5c6c8a1fe91 Mon Sep 17 00:00:00 2001 +From: Miquel Raynal +Date: Thu, 16 Aug 2018 17:30:18 +0200 +Subject: [PATCH] mtd: declare MTD_PARTITIONS symbol in Kconfig + +UBI selects MTD_PARTITIONS which is the symbol to compile +drivers/mtd/mtdpart.c. Unfortunately, the symbol was not defined in +Kconfig and this worked only with board files defining it. Fix this by +adding a boolean in Kconfig so boards defined by defconfig files only +will work as expected. + +Signed-off-by: Miquel Raynal +Reviewed-by: Boris Brezillon +--- + drivers/mtd/Kconfig | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig +index 9341d518f3e..d98457e2239 100644 +--- a/drivers/mtd/Kconfig ++++ b/drivers/mtd/Kconfig +@@ -1,5 +1,8 @@ + menu "MTD Support" + ++config MTD_PARTITIONS ++ bool ++ + config MTD + bool "Enable Driver Model for MTD drivers" + depends on DM +-- +2.21.0 +