diff mbox series

[1/1] configs/mangopi_mq_d1s: new defconfig

Message ID CA+fTLhg9R0KwFb-EZKEYy2U_WgdRzBZyJ6QrmCUv4dCB_kfo8A@mail.gmail.com
State Changes Requested
Headers show
Series [1/1] configs/mangopi_mq_d1s: new defconfig | expand

Commit Message

Indrek Kruusa Aug. 9, 2023, 5:32 p.m. UTC
This patch adds the support for the MangoPi MQ D1s board.
Allwinner D1/D1s SOC and this particular board is partially supported by
mainline linux kernel so the current configuration runs on mainline 6.4.x
series. Improved support (PWM,SPI,CAN,audio) is coming in the near future.
The provided kernel configuration in linux.fragment ensures that the compiled
kernel is suitable for the board with 64MB RAM (integrated into the CPU).
The configuration is using an u-boot version provided by Samuel Holland.

Signed-off-by: Indrek Kruusa <indrek.kruusa@gmail.com>
---
 DEVELOPERS                                    |  4 ++
 board/mangopi-mq-d1s/genimage.cfg             | 20 ++++++
 board/mangopi-mq-d1s/linux.fragment           | 70 +++++++++++++++++++
 .../overlay/boot/extlinux/extlinux.conf       |  4 ++
 .../overlay/etc/network/interfaces            |  6 ++
 .../overlay/etc/wpa_supplicant.conf           |  8 +++
 board/mangopi-mq-d1s/readme.txt               | 48 +++++++++++++
 board/mangopi-mq-d1s/uboot_board_defconfig    | 10 +++
 configs/mangopi_mq_d1s_defconfig              | 47 +++++++++++++
 9 files changed, 217 insertions(+)
 create mode 100644 board/mangopi-mq-d1s/genimage.cfg
 create mode 100644 board/mangopi-mq-d1s/linux.fragment
 create mode 100644 board/mangopi-mq-d1s/overlay/boot/extlinux/extlinux.conf
 create mode 100644 board/mangopi-mq-d1s/overlay/etc/network/interfaces
 create mode 100644 board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf
 create mode 100644 board/mangopi-mq-d1s/readme.txt
 create mode 100644 board/mangopi-mq-d1s/uboot_board_defconfig
 create mode 100644 configs/mangopi_mq_d1s_defconfig

+BR2_PACKAGE_HOST_GENIMAGE=y

Comments

Indrek Kruusa Aug. 9, 2023, 5:35 p.m. UTC | #1
Sorry, it seems to be line wrapped. Will resend.
Br,
Indrek


Kontakt Indrek Kruusa (<indrek.kruusa@gmail.com>) kirjutas kuupƤeval
K, 9. august 2023 kell 20:32:
>
> This patch adds the support for the MangoPi MQ D1s board.
> Allwinner D1/D1s SOC and this particular board is partially supported by
> mainline linux kernel so the current configuration runs on mainline 6.4.x
> series. Improved support (PWM,SPI,CAN,audio) is coming in the near future.
> The provided kernel configuration in linux.fragment ensures that the compiled
> kernel is suitable for the board with 64MB RAM (integrated into the CPU).
> The configuration is using an u-boot version provided by Samuel Holland.
>
> Signed-off-by: Indrek Kruusa <indrek.kruusa@gmail.com>
> ---
>  DEVELOPERS                                    |  4 ++
>  board/mangopi-mq-d1s/genimage.cfg             | 20 ++++++
>  board/mangopi-mq-d1s/linux.fragment           | 70 +++++++++++++++++++
>  .../overlay/boot/extlinux/extlinux.conf       |  4 ++
>  .../overlay/etc/network/interfaces            |  6 ++
>  .../overlay/etc/wpa_supplicant.conf           |  8 +++
>  board/mangopi-mq-d1s/readme.txt               | 48 +++++++++++++
>  board/mangopi-mq-d1s/uboot_board_defconfig    | 10 +++
>  configs/mangopi_mq_d1s_defconfig              | 47 +++++++++++++
>  9 files changed, 217 insertions(+)
>  create mode 100644 board/mangopi-mq-d1s/genimage.cfg
>  create mode 100644 board/mangopi-mq-d1s/linux.fragment
>  create mode 100644 board/mangopi-mq-d1s/overlay/boot/extlinux/extlinux.conf
>  create mode 100644 board/mangopi-mq-d1s/overlay/etc/network/interfaces
>  create mode 100644 board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf
>  create mode 100644 board/mangopi-mq-d1s/readme.txt
>  create mode 100644 board/mangopi-mq-d1s/uboot_board_defconfig
>  create mode 100644 configs/mangopi_mq_d1s_defconfig
>
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 0f6cb75e0e..83a539b46f 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1334,6 +1334,10 @@ F: package/keepalived/
>  N: Ilya Averyanov <averyanovin@gmail.com>
>  F: package/exempi/
>
> +N: Indrek Kruusa <indrek.kruusa@gmail.com>
> +F: configs/mangopi_mq_d1s_defconfig
> +F: board/mangopi-mq-d1s
> +
>  N: Ismael Luceno <ismael@iodev.co.uk>
>  F: package/axel/
>  F: package/mawk/
> diff --git a/board/mangopi-mq-d1s/genimage.cfg
> b/board/mangopi-mq-d1s/genimage.cfg
> new file mode 100644
> index 0000000000..3acf78a3ab
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/genimage.cfg
> @@ -0,0 +1,20 @@
> +# Minimal SD card image for the MangoPi MQ F133 D1s
> +# https://mangopi.org/mangopi_mq
> +
> +image sdcard.img {
> + hdimage {
> + }
> +
> + partition u-boot {
> + in-partition-table = false
> + image = "u-boot-sunxi-with-spl.bin"
> + offset = 8K
> + }
> +
> + partition rootfs {
> + partition-type = 0x83
> + image = "rootfs.ext4"
> + bootable = "true"
> + offset = 1M
> + }
> +}
> diff --git a/board/mangopi-mq-d1s/linux.fragment
> b/board/mangopi-mq-d1s/linux.fragment
> new file mode 100644
> index 0000000000..20a24f841d
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/linux.fragment
> @@ -0,0 +1,70 @@
> +# CONFIG_SOC_MICROCHIP_POLARFIRE is not set
> +# CONFIG_ARCH_RENESAS is not set
> +# CONFIG_SOC_SIFIVE is not set
> +# CONFIG_SOC_STARFIVE is not set
> +# CONFIG_SOC_VIRT is not set
> +# CONFIG_ERRATA_SIFIVE is not set
> +CONFIG_BROKEN_ON_SMP=y
> +# CONFIG_SMP is not set
> +CONFIG_NONPORTABLE=y
> +CONFIG_HZ_250=y
> +CONFIG_RISCV_SBI_CPUIDLE=y
> +# CONFIG_EFI is not set
> +# CONFIG_CPU_FREQ is not set
> +# CONFIG_KPROBES is not set
> +# CONFIG_SWAP is not set
> +# CONFIG_ZSWAP is not set
> +# CONFIG_VIRTUALIZATION is not set
> +# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
> +CONFIG_SYSVIPC_COMPAT=y
> +CONFIG_POSIX_MQUEUE is not set
> +CONFIG_PREEMPT_BUILD=y
> +CONFIG_PREEMPT=y
> +CONFIG_PREEMPTION=y
> +CONFIG_NEED_PER_CPU_KM=y
> +# CONFIG_CGROUP_HUGETLB is not set
> +# CONFIG_CGROUP_PERF is not set
> +# CONFIG_CHECKPOINT_RESTORE is not set
> +# CONFIG_BLK_DEV_INITRD is not set
> +# CONFIG_PROFILING is not set
> +# CONFIG_MQ_IOSCHED_DEADLINE is not set
> +# CONFIG_MQ_IOSCHED_KYBER is not set
> +# CONFIG_IOSCHED_BFQ is not set
> +CONFIG_COMPAT=y
> +# CONFIG_STACKPROTECTOR is not set
> +CONFIG_FLATMEM_MANUAL=y
> +# CONFIG_SPARSEMEM_MANUAL is not set
> +CONFIG_FLATMEM=y
> +CONFIG_SUN50I_DE2_BUS=y
> +CONFIG_SUNXI_RSB=y
> +CONFIG_GPIO_GENERIC_PLATFORM=y
> +# CONFIG_LEGACY_PTYS is not set
> +# CONFIG_LEGACY_TIOCSTI is not set
> +# CONFIG_SERIAL_8250_PCI is not set
> +# CONFIG_SERIAL_SIFIVE is not set
> +# CONFIG_SPI_SIFIVE is not set
> +# CONFIG_GPIO_SIFIVE is not set
> +# CONFIG_VHOST_MENU is not set
> +# CONFIG_GOLDFISH is not set
> +# CONFIG_NET_9P is not set
> +# CONFIG_BLK_DEV_NVME is not set
> +# CONFIG_BLK_DEBUG_FS is not set
> +# CONFIG_SCSI is not set
> +# CONFIG_ATA is not set
> +# CONFIG_DRM_RADEON is not set
> +# CONFIG_DRM_NOUVEAU is not set
> +# CONFIG_RAID6_PQ_BENCHMARK is not set
> +# CONFIG_DEBUG_PREEMPT is not set
> +# CONFIG_LIBNVDIMM is not set
> +# CONFIG_DAX is not set
> +# CONFIG_ETHERNET is not set
> +# CONFIG_PHYLIB is not set
> +# CONFIG_USB_NET_DRIVERS is not set
> +# CONFIG_WLAN is not set
> +# CONFIG_SPI is not set
> +# CONFIG_NFS_SWAP is not set
> +CONFIG_PINCTRL_SUNXI=y
> +CONFIG_PINCTRL_SUN20I_D1=y
> +# CONFIG_VIRTIO_BLK is not set
> +# CONFIG_MD is not set
> +# CONFIG_VIRTIO_MENU is not set
> diff --git a/board/mangopi-mq-d1s/overlay/boot/extlinux/extlinux.conf
> b/board/mangopi-mq-d1s/overlay/boot/extlinux/extlinux.conf
> new file mode 100644
> index 0000000000..c825ad4667
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/overlay/boot/extlinux/extlinux.conf
> @@ -0,0 +1,4 @@
> +label linux
> +  kernel /boot/Image
> +  # use devicetree from u-boot
> +  append console=ttyS3,115200 root=/dev/mmcblk0p1 ro rootwait
> diff --git a/board/mangopi-mq-d1s/overlay/etc/network/interfaces
> b/board/mangopi-mq-d1s/overlay/etc/network/interfaces
> new file mode 100644
> index 0000000000..89e7d74aff
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/overlay/etc/network/interfaces
> @@ -0,0 +1,6 @@
> +auto lo
> +iface lo inet loopback
> +
> +auto wlan0
> +iface wlan0 inet dhcp
> +wpa-conf /etc/wpa_supplicant.conf
> diff --git a/board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf
> b/board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf
> new file mode 100644
> index 0000000000..b43292b0a7
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf
> @@ -0,0 +1,8 @@
> +ap_scan=1
> +
> +network={
> +        ssid="YOURSSID"
> +        scan_ssid=1
> +        key_mgmt=WPA-PSK
> +        psk="YOURPASSWD"
> +}
> diff --git a/board/mangopi-mq-d1s/readme.txt b/board/mangopi-mq-d1s/readme.txt
> new file mode 100644
> index 0000000000..60b148764e
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/readme.txt
> @@ -0,0 +1,48 @@
> +MangoPi MQ D1s (RISC-V)
> +=======================
> +
> +MangoPi MQ D1s (board model MQ1W) is a tiny (4x4cm) RISC-V based
> single board computer. It's built around
> +Allwinner D1s (also referred as F133) single core 1GHz CPU with
> integrated 64MB DDR2 RAM.
> +Board features:
> +- USB-OTG Type-C socket
> +- USB-HOST Type-C socket
> +- 2x 22 pin GPIO headers
> +- TF card slot
> +- RTL8189FTV WiFi module with ext. antenna connector
> +- 15 pin DSI FPC connector
> +- 40 pin RGB FPC connector
> +- 6 pin CTP FPC connector
> +- 24 pin DVP FPC connector
> +- onboard mic
> +- onboard audio amplifier
> +- FEL,reset button
> +
> +There is no HDMI connector.
> +
> +How to build
> +============
> +
> +$ make mangopi_mq_d1s_defconfig
> +$ make
> +
> +Wifi
> +==========
> +
> +Edit  board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf or
> +/etc/wpa_supplicant.conf once connected to the board:
> +
> +* Replace YOURSSID with your AP ssid
> +* Replace YOURPASSWD with your AP password
> +
> +How to write the SD card
> +========================
> +
> +Once the build process is finished you will have an image called "sdcard.img"
> +in the output/images/ directory.
> +
> +Copy the bootable "sdcard.img" onto an SD card with "dd":
> +
> +  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
> +
> +Connect a TTL UART to the UART3 on P8 header (unpopulated), insert
> the microSD card and
> +plug in a USB-C cable to the OTG or HOST connector to boot the system.
> diff --git a/board/mangopi-mq-d1s/uboot_board_defconfig
> b/board/mangopi-mq-d1s/uboot_board_defconfig
> new file mode 100644
> index 0000000000..0a3d8ded01
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/uboot_board_defconfig
> @@ -0,0 +1,10 @@
> +CONFIG_RISCV=y
> +CONFIG_DEFAULT_DEVICE_TREE="sun20i-d1s-mangopi-mq"
> +CONFIG_TARGET_SUN20I_D1=y
> +CONFIG_ARCH_RV64I=y
> +CONFIG_RISCV_SMODE=y
> +# CONFIG_SPL_SMP is not set
> +CONFIG_SYS_SPL_MALLOC=y
> +CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS=0x0
> +# CONFIG_SYS_I2C_MVTWSI is not set
> +CONFIG_DM_REGULATOR_FIXED=y
> diff --git a/configs/mangopi_mq_d1s_defconfig b/configs/mangopi_mq_d1s_defconfig
> new file mode 100644
> index 0000000000..0d2a3c40dd
> --- /dev/null
> +++ b/configs/mangopi_mq_d1s_defconfig
> @@ -0,0 +1,47 @@
> +BR2_riscv=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y
> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
> +BR2_ROOTFS_OVERLAY="board/mangopi-mq-d1s/overlay"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/mangopi-mq-d1s/genimage.cfg"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.8"
> +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/mangopi-mq-d1s/linux.fragment"
> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1s-mangopi-mq"
> +BR2_LINUX_KERNEL_INSTALL_TARGET=y
> +BR2_PACKAGE_RTL8189FS=y
> +BR2_PACKAGE_WIRELESS_TOOLS=y
> +BR2_PACKAGE_WPA_SUPPLICANT=y
> +BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
> +BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
> +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
> +BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
> +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
> +BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +# BR2_TARGET_ROOTFS_TAR is not set
> +BR2_TARGET_OPENSBI=y
> +BR2_TARGET_OPENSBI_PLAT="generic"
> +# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
> +BR2_TARGET_OPENSBI_LATEST_VERSION=y
> +# BR2_TARGET_OPENSBI_CUSTOM_VERSION is not set
> +BR2_TARGET_OPENSBI_VERSION="1.3"
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call
> github,smaeul,u-boot,for-conor)/uboot-for-conor.tar.gz"
> +# BR2_TARGET_UBOOT_USE_DEFCONFIG is not set
> +BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="board/mangopi-mq-d1s/uboot_board_defconfig"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
> +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
> +BR2_TARGET_UBOOT_NEEDS_OPENSBI=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_PACKAGE_HOST_GENIMAGE=y
> --
> 2.34.1
Thomas Petazzoni Aug. 9, 2023, 5:57 p.m. UTC | #2
Hello Indrek,

On Wed, 9 Aug 2023 20:32:15 +0300
Indrek Kruusa <indrek.kruusa@gmail.com> wrote:

> This patch adds the support for the MangoPi MQ D1s board.
> Allwinner D1/D1s SOC and this particular board is partially supported by
> mainline linux kernel so the current configuration runs on mainline 6.4.x
> series. Improved support (PWM,SPI,CAN,audio) is coming in the near future.
> The provided kernel configuration in linux.fragment ensures that the compiled
> kernel is suitable for the board with 64MB RAM (integrated into the CPU).
> The configuration is using an u-boot version provided by Samuel Holland.
> 
> Signed-off-by: Indrek Kruusa <indrek.kruusa@gmail.com>

I know you will resend, but a few comments anyway.

> diff --git a/DEVELOPERS b/DEVELOPERS
> index 0f6cb75e0e..83a539b46f 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1334,6 +1334,10 @@ F: package/keepalived/
>  N: Ilya Averyanov <averyanovin@gmail.com>
>  F: package/exempi/
> 
> +N: Indrek Kruusa <indrek.kruusa@gmail.com>
> +F: configs/mangopi_mq_d1s_defconfig
> +F: board/mangopi-mq-d1s

We normally try to have board/<vendor>/<board>/

Also, a final slash when the entry matches a directory.



> +
>  N: Ismael Luceno <ismael@iodev.co.uk>
>  F: package/axel/
>  F: package/mawk/
> diff --git a/board/mangopi-mq-d1s/genimage.cfg
> b/board/mangopi-mq-d1s/genimage.cfg
> new file mode 100644
> index 0000000000..3acf78a3ab
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/genimage.cfg
> @@ -0,0 +1,20 @@
> +# Minimal SD card image for the MangoPi MQ F133 D1s
> +# https://mangopi.org/mangopi_mq
> +
> +image sdcard.img {
> + hdimage {
> + }
> +
> + partition u-boot {
> + in-partition-table = false
> + image = "u-boot-sunxi-with-spl.bin"
> + offset = 8K
> + }
> +
> + partition rootfs {
> + partition-type = 0x83
> + image = "rootfs.ext4"
> + bootable = "true"
> + offset = 1M
> + }
> +}

Please match the indentation with other genimage.cfg files (maybe the
indentation got eaten up by your e-mail client).

> diff --git a/board/mangopi-mq-d1s/linux.fragment
> b/board/mangopi-mq-d1s/linux.fragment
> new file mode 100644
> index 0000000000..20a24f841d
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/linux.fragment
> @@ -0,0 +1,70 @@
> +# CONFIG_SOC_MICROCHIP_POLARFIRE is not set
> +# CONFIG_ARCH_RENESAS is not set
> +# CONFIG_SOC_SIFIVE is not set
> +# CONFIG_SOC_STARFIVE is not set
> +# CONFIG_SOC_VIRT is not set
> +# CONFIG_ERRATA_SIFIVE is not set
> +CONFIG_BROKEN_ON_SMP=y
> +# CONFIG_SMP is not set
> +CONFIG_NONPORTABLE=y
> +CONFIG_HZ_250=y
> +CONFIG_RISCV_SBI_CPUIDLE=y
> +# CONFIG_EFI is not set
> +# CONFIG_CPU_FREQ is not set
> +# CONFIG_KPROBES is not set
> +# CONFIG_SWAP is not set
> +# CONFIG_ZSWAP is not set
> +# CONFIG_VIRTUALIZATION is not set
> +# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
> +CONFIG_SYSVIPC_COMPAT=y
> +CONFIG_POSIX_MQUEUE is not set
> +CONFIG_PREEMPT_BUILD=y
> +CONFIG_PREEMPT=y
> +CONFIG_PREEMPTION=y
> +CONFIG_NEED_PER_CPU_KM=y
> +# CONFIG_CGROUP_HUGETLB is not set
> +# CONFIG_CGROUP_PERF is not set
> +# CONFIG_CHECKPOINT_RESTORE is not set
> +# CONFIG_BLK_DEV_INITRD is not set
> +# CONFIG_PROFILING is not set
> +# CONFIG_MQ_IOSCHED_DEADLINE is not set
> +# CONFIG_MQ_IOSCHED_KYBER is not set
> +# CONFIG_IOSCHED_BFQ is not set
> +CONFIG_COMPAT=y
> +# CONFIG_STACKPROTECTOR is not set
> +CONFIG_FLATMEM_MANUAL=y
> +# CONFIG_SPARSEMEM_MANUAL is not set
> +CONFIG_FLATMEM=y
> +CONFIG_SUN50I_DE2_BUS=y
> +CONFIG_SUNXI_RSB=y
> +CONFIG_GPIO_GENERIC_PLATFORM=y
> +# CONFIG_LEGACY_PTYS is not set
> +# CONFIG_LEGACY_TIOCSTI is not set
> +# CONFIG_SERIAL_8250_PCI is not set
> +# CONFIG_SERIAL_SIFIVE is not set
> +# CONFIG_SPI_SIFIVE is not set
> +# CONFIG_GPIO_SIFIVE is not set
> +# CONFIG_VHOST_MENU is not set
> +# CONFIG_GOLDFISH is not set
> +# CONFIG_NET_9P is not set
> +# CONFIG_BLK_DEV_NVME is not set
> +# CONFIG_BLK_DEBUG_FS is not set
> +# CONFIG_SCSI is not set
> +# CONFIG_ATA is not set
> +# CONFIG_DRM_RADEON is not set
> +# CONFIG_DRM_NOUVEAU is not set
> +# CONFIG_RAID6_PQ_BENCHMARK is not set
> +# CONFIG_DEBUG_PREEMPT is not set
> +# CONFIG_LIBNVDIMM is not set
> +# CONFIG_DAX is not set
> +# CONFIG_ETHERNET is not set
> +# CONFIG_PHYLIB is not set
> +# CONFIG_USB_NET_DRIVERS is not set
> +# CONFIG_WLAN is not set
> +# CONFIG_SPI is not set
> +# CONFIG_NFS_SWAP is not set
> +CONFIG_PINCTRL_SUNXI=y
> +CONFIG_PINCTRL_SUN20I_D1=y
> +# CONFIG_VIRTIO_BLK is not set
> +# CONFIG_MD is not set
> +# CONFIG_VIRTIO_MENU is not set

Not sure if a fragment or a defconfig is better here. If the fragment
is in the end disabling almost all what's in the default defconfig,
perhaps provide your own defconfig instead?


> diff --git a/board/mangopi-mq-d1s/uboot_board_defconfig
> b/board/mangopi-mq-d1s/uboot_board_defconfig
> new file mode 100644
> index 0000000000..0a3d8ded01
> --- /dev/null
> +++ b/board/mangopi-mq-d1s/uboot_board_defconfig

uboot.config or u-boot.config for the file name.

> diff --git a/configs/mangopi_mq_d1s_defconfig b/configs/mangopi_mq_d1s_defconfig
> new file mode 100644
> index 0000000000..0d2a3c40dd
> --- /dev/null
> +++ b/configs/mangopi_mq_d1s_defconfig
> @@ -0,0 +1,47 @@
> +BR2_riscv=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y
> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
> +BR2_ROOTFS_OVERLAY="board/mangopi-mq-d1s/overlay"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/mangopi-mq-d1s/genimage.cfg"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.8"
> +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/mangopi-mq-d1s/linux.fragment"
> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1s-mangopi-mq"
> +BR2_LINUX_KERNEL_INSTALL_TARGET=y
> +BR2_PACKAGE_RTL8189FS=y
> +BR2_PACKAGE_WIRELESS_TOOLS=y
> +BR2_PACKAGE_WPA_SUPPLICANT=y
> +BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
> +BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
> +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
> +BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
> +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
> +BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y

I was initially not sure about enabling wpa-supplicant, but it's true
that if the platform only has WiFi connectivity (no Ethernet) it
probably makes sense to have it enabled by default.

> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +# BR2_TARGET_ROOTFS_TAR is not set
> +BR2_TARGET_OPENSBI=y
> +BR2_TARGET_OPENSBI_PLAT="generic"
> +# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
> +BR2_TARGET_OPENSBI_LATEST_VERSION=y
> +# BR2_TARGET_OPENSBI_CUSTOM_VERSION is not set
> +BR2_TARGET_OPENSBI_VERSION="1.3"
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call
> github,smaeul,u-boot,for-conor)/uboot-for-conor.tar.gz"

This point to a branch, which can move over time. Can you change that
to point to a tag or a commit hash?

The rest looks good really, so not much to fix.

Thanks!

Thomas
Indrek Kruusa Aug. 9, 2023, 7:40 p.m. UTC | #3
Kontakt Thomas Petazzoni (<thomas.petazzoni@bootlin.com>) kirjutas
kuupƤeval K, 9. august 2023 kell 20:57:
>
> Hello Indrek,
>
> On Wed, 9 Aug 2023 20:32:15 +0300
> Indrek Kruusa <indrek.kruusa@gmail.com> wrote:
>
> > This patch adds the support for the MangoPi MQ D1s board.
> > Allwinner D1/D1s SOC and this particular board is partially supported by
> > mainline linux kernel so the current configuration runs on mainline 6.4.x
> > series. Improved support (PWM,SPI,CAN,audio) is coming in the near future.
> > The provided kernel configuration in linux.fragment ensures that the compiled
> > kernel is suitable for the board with 64MB RAM (integrated into the CPU).
> > The configuration is using an u-boot version provided by Samuel Holland.
> >
> > Signed-off-by: Indrek Kruusa <indrek.kruusa@gmail.com>
>
> I know you will resend, but a few comments anyway.

Thanks for the prompt review!

>
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index 0f6cb75e0e..83a539b46f 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -1334,6 +1334,10 @@ F: package/keepalived/
> >  N: Ilya Averyanov <averyanovin@gmail.com>
> >  F: package/exempi/
> >
> > +N: Indrek Kruusa <indrek.kruusa@gmail.com>
> > +F: configs/mangopi_mq_d1s_defconfig
> > +F: board/mangopi-mq-d1s
>
> We normally try to have board/<vendor>/<board>/

I was considering that but it's rather tricky for such boards. MangoPi
boards are manufactured by AWOL (there is a logo on the board
usually). In fact this is a subsidiary of the Allwinner but I tend to
think this name doesn't ring a bell for most people. Second, there is
a website mangopi.org which consolidates information about different
mangopi boards. So the 'mangopi' could be the "vendor" also... kind
of. I really don't know what to do about it.

> Also, a final slash when the entry matches a directory.
>

OK.

>
>
> > +
> >  N: Ismael Luceno <ismael@iodev.co.uk>
> >  F: package/axel/
> >  F: package/mawk/
> > diff --git a/board/mangopi-mq-d1s/genimage.cfg
> > b/board/mangopi-mq-d1s/genimage.cfg
> > new file mode 100644
> > index 0000000000..3acf78a3ab
> > --- /dev/null
> > +++ b/board/mangopi-mq-d1s/genimage.cfg
> > @@ -0,0 +1,20 @@
> > +# Minimal SD card image for the MangoPi MQ F133 D1s
> > +# https://mangopi.org/mangopi_mq
> > +
> > +image sdcard.img {
> > + hdimage {
> > + }
> > +
> > + partition u-boot {
> > + in-partition-table = false
> > + image = "u-boot-sunxi-with-spl.bin"
> > + offset = 8K
> > + }
> > +
> > + partition rootfs {
> > + partition-type = 0x83
> > + image = "rootfs.ext4"
> > + bootable = "true"
> > + offset = 1M
> > + }
> > +}
>
> Please match the indentation with other genimage.cfg files (maybe the
> indentation got eaten up by your e-mail client).
>
> > diff --git a/board/mangopi-mq-d1s/linux.fragment
> > b/board/mangopi-mq-d1s/linux.fragment
> > new file mode 100644
> > index 0000000000..20a24f841d
> > --- /dev/null
> > +++ b/board/mangopi-mq-d1s/linux.fragment
> > @@ -0,0 +1,70 @@
> > +# CONFIG_SOC_MICROCHIP_POLARFIRE is not set
> > +# CONFIG_ARCH_RENESAS is not set
> > +# CONFIG_SOC_SIFIVE is not set
> > +# CONFIG_SOC_STARFIVE is not set
> > +# CONFIG_SOC_VIRT is not set
> > +# CONFIG_ERRATA_SIFIVE is not set
> > +CONFIG_BROKEN_ON_SMP=y
> > +# CONFIG_SMP is not set
> > +CONFIG_NONPORTABLE=y
> > +CONFIG_HZ_250=y
> > +CONFIG_RISCV_SBI_CPUIDLE=y
> > +# CONFIG_EFI is not set
> > +# CONFIG_CPU_FREQ is not set
> > +# CONFIG_KPROBES is not set
> > +# CONFIG_SWAP is not set
> > +# CONFIG_ZSWAP is not set
> > +# CONFIG_VIRTUALIZATION is not set
> > +# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
> > +CONFIG_SYSVIPC_COMPAT=y
> > +CONFIG_POSIX_MQUEUE is not set
> > +CONFIG_PREEMPT_BUILD=y
> > +CONFIG_PREEMPT=y
> > +CONFIG_PREEMPTION=y
> > +CONFIG_NEED_PER_CPU_KM=y
> > +# CONFIG_CGROUP_HUGETLB is not set
> > +# CONFIG_CGROUP_PERF is not set
> > +# CONFIG_CHECKPOINT_RESTORE is not set
> > +# CONFIG_BLK_DEV_INITRD is not set
> > +# CONFIG_PROFILING is not set
> > +# CONFIG_MQ_IOSCHED_DEADLINE is not set
> > +# CONFIG_MQ_IOSCHED_KYBER is not set
> > +# CONFIG_IOSCHED_BFQ is not set
> > +CONFIG_COMPAT=y
> > +# CONFIG_STACKPROTECTOR is not set
> > +CONFIG_FLATMEM_MANUAL=y
> > +# CONFIG_SPARSEMEM_MANUAL is not set
> > +CONFIG_FLATMEM=y
> > +CONFIG_SUN50I_DE2_BUS=y
> > +CONFIG_SUNXI_RSB=y
> > +CONFIG_GPIO_GENERIC_PLATFORM=y
> > +# CONFIG_LEGACY_PTYS is not set
> > +# CONFIG_LEGACY_TIOCSTI is not set
> > +# CONFIG_SERIAL_8250_PCI is not set
> > +# CONFIG_SERIAL_SIFIVE is not set
> > +# CONFIG_SPI_SIFIVE is not set
> > +# CONFIG_GPIO_SIFIVE is not set
> > +# CONFIG_VHOST_MENU is not set
> > +# CONFIG_GOLDFISH is not set
> > +# CONFIG_NET_9P is not set
> > +# CONFIG_BLK_DEV_NVME is not set
> > +# CONFIG_BLK_DEBUG_FS is not set
> > +# CONFIG_SCSI is not set
> > +# CONFIG_ATA is not set
> > +# CONFIG_DRM_RADEON is not set
> > +# CONFIG_DRM_NOUVEAU is not set
> > +# CONFIG_RAID6_PQ_BENCHMARK is not set
> > +# CONFIG_DEBUG_PREEMPT is not set
> > +# CONFIG_LIBNVDIMM is not set
> > +# CONFIG_DAX is not set
> > +# CONFIG_ETHERNET is not set
> > +# CONFIG_PHYLIB is not set
> > +# CONFIG_USB_NET_DRIVERS is not set
> > +# CONFIG_WLAN is not set
> > +# CONFIG_SPI is not set
> > +# CONFIG_NFS_SWAP is not set
> > +CONFIG_PINCTRL_SUNXI=y
> > +CONFIG_PINCTRL_SUN20I_D1=y
> > +# CONFIG_VIRTIO_BLK is not set
> > +# CONFIG_MD is not set
> > +# CONFIG_VIRTIO_MENU is not set
>
> Not sure if a fragment or a defconfig is better here. If the fragment
> is in the end disabling almost all what's in the default defconfig,
> perhaps provide your own defconfig instead?

Yes, I was also thinking that defconfig is easier to maintain. Will change that.

>
>
> > diff --git a/board/mangopi-mq-d1s/uboot_board_defconfig
> > b/board/mangopi-mq-d1s/uboot_board_defconfig
> > new file mode 100644
> > index 0000000000..0a3d8ded01
> > --- /dev/null
> > +++ b/board/mangopi-mq-d1s/uboot_board_defconfig
>
> uboot.config or u-boot.config for the file name.
>
> > diff --git a/configs/mangopi_mq_d1s_defconfig b/configs/mangopi_mq_d1s_defconfig
> > new file mode 100644
> > index 0000000000..0d2a3c40dd
> > --- /dev/null
> > +++ b/configs/mangopi_mq_d1s_defconfig
> > @@ -0,0 +1,47 @@
> > +BR2_riscv=y
> > +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y
> > +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
> > +BR2_ROOTFS_OVERLAY="board/mangopi-mq-d1s/overlay"
> > +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> > +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/mangopi-mq-d1s/genimage.cfg"
> > +BR2_LINUX_KERNEL=y
> > +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> > +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.8"
> > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/mangopi-mq-d1s/linux.fragment"
> > +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> > +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> > +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1s-mangopi-mq"
> > +BR2_LINUX_KERNEL_INSTALL_TARGET=y
> > +BR2_PACKAGE_RTL8189FS=y
> > +BR2_PACKAGE_WIRELESS_TOOLS=y
> > +BR2_PACKAGE_WPA_SUPPLICANT=y
> > +BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
> > +BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
> > +BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
> > +BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
> > +BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
> > +BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y
>
> I was initially not sure about enabling wpa-supplicant, but it's true
> that if the platform only has WiFi connectivity (no Ethernet) it
> probably makes sense to have it enabled by default.
>
> > +BR2_TARGET_ROOTFS_EXT2=y
> > +BR2_TARGET_ROOTFS_EXT2_4=y
> > +# BR2_TARGET_ROOTFS_TAR is not set
> > +BR2_TARGET_OPENSBI=y
> > +BR2_TARGET_OPENSBI_PLAT="generic"
> > +# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
> > +BR2_TARGET_OPENSBI_LATEST_VERSION=y
> > +# BR2_TARGET_OPENSBI_CUSTOM_VERSION is not set
> > +BR2_TARGET_OPENSBI_VERSION="1.3"
> > +BR2_TARGET_UBOOT=y
> > +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> > +BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
> > +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call
> > github,smaeul,u-boot,for-conor)/uboot-for-conor.tar.gz"
>
> This point to a branch, which can move over time. Can you change that
> to point to a tag or a commit hash?

Will do.

Thanks,
Indrek


>
> The rest looks good really, so not much to fix.
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
Thomas Petazzoni Aug. 9, 2023, 8:49 p.m. UTC | #4
On Wed, 9 Aug 2023 22:40:14 +0300
Indrek Kruusa <indrek.kruusa@gmail.com> wrote:

> > We normally try to have board/<vendor>/<board>/  
> 
> I was considering that but it's rather tricky for such boards. MangoPi
> boards are manufactured by AWOL (there is a logo on the board
> usually). In fact this is a subsidiary of the Allwinner but I tend to
> think this name doesn't ring a bell for most people. Second, there is
> a website mangopi.org which consolidates information about different
> mangopi boards. So the 'mangopi' could be the "vendor" also... kind
> of. I really don't know what to do about it.

Lets do board/mangopi/mangopi-mq-d1s/ then. We can always revisit later
if need be.

Thanks!

Thomas
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 0f6cb75e0e..83a539b46f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1334,6 +1334,10 @@  F: package/keepalived/
 N: Ilya Averyanov <averyanovin@gmail.com>
 F: package/exempi/

+N: Indrek Kruusa <indrek.kruusa@gmail.com>
+F: configs/mangopi_mq_d1s_defconfig
+F: board/mangopi-mq-d1s
+
 N: Ismael Luceno <ismael@iodev.co.uk>
 F: package/axel/
 F: package/mawk/
diff --git a/board/mangopi-mq-d1s/genimage.cfg
b/board/mangopi-mq-d1s/genimage.cfg
new file mode 100644
index 0000000000..3acf78a3ab
--- /dev/null
+++ b/board/mangopi-mq-d1s/genimage.cfg
@@ -0,0 +1,20 @@ 
+# Minimal SD card image for the MangoPi MQ F133 D1s
+# https://mangopi.org/mangopi_mq
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition u-boot {
+ in-partition-table = false
+ image = "u-boot-sunxi-with-spl.bin"
+ offset = 8K
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext4"
+ bootable = "true"
+ offset = 1M
+ }
+}
diff --git a/board/mangopi-mq-d1s/linux.fragment
b/board/mangopi-mq-d1s/linux.fragment
new file mode 100644
index 0000000000..20a24f841d
--- /dev/null
+++ b/board/mangopi-mq-d1s/linux.fragment
@@ -0,0 +1,70 @@ 
+# CONFIG_SOC_MICROCHIP_POLARFIRE is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_SOC_SIFIVE is not set
+# CONFIG_SOC_STARFIVE is not set
+# CONFIG_SOC_VIRT is not set
+# CONFIG_ERRATA_SIFIVE is not set
+CONFIG_BROKEN_ON_SMP=y
+# CONFIG_SMP is not set
+CONFIG_NONPORTABLE=y
+CONFIG_HZ_250=y
+CONFIG_RISCV_SBI_CPUIDLE=y
+# CONFIG_EFI is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_KPROBES is not set
+# CONFIG_SWAP is not set
+# CONFIG_ZSWAP is not set
+# CONFIG_VIRTUALIZATION is not set
+# CONFIG_BLOCK_LEGACY_AUTOLOAD is not set
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_POSIX_MQUEUE is not set
+CONFIG_PREEMPT_BUILD=y
+CONFIG_PREEMPT=y
+CONFIG_PREEMPTION=y
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CGROUP_HUGETLB is not set
+# CONFIG_CGROUP_PERF is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MQ_IOSCHED_DEADLINE is not set
+# CONFIG_MQ_IOSCHED_KYBER is not set
+# CONFIG_IOSCHED_BFQ is not set
+CONFIG_COMPAT=y
+# CONFIG_STACKPROTECTOR is not set
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_SUN50I_DE2_BUS=y
+CONFIG_SUNXI_RSB=y
+CONFIG_GPIO_GENERIC_PLATFORM=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_LEGACY_TIOCSTI is not set
+# CONFIG_SERIAL_8250_PCI is not set
+# CONFIG_SERIAL_SIFIVE is not set
+# CONFIG_SPI_SIFIVE is not set
+# CONFIG_GPIO_SIFIVE is not set
+# CONFIG_VHOST_MENU is not set
+# CONFIG_GOLDFISH is not set
+# CONFIG_NET_9P is not set
+# CONFIG_BLK_DEV_NVME is not set
+# CONFIG_BLK_DEBUG_FS is not set
+# CONFIG_SCSI is not set
+# CONFIG_ATA is not set
+# CONFIG_DRM_RADEON is not set
+# CONFIG_DRM_NOUVEAU is not set
+# CONFIG_RAID6_PQ_BENCHMARK is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_LIBNVDIMM is not set
+# CONFIG_DAX is not set
+# CONFIG_ETHERNET is not set
+# CONFIG_PHYLIB is not set
+# CONFIG_USB_NET_DRIVERS is not set
+# CONFIG_WLAN is not set
+# CONFIG_SPI is not set
+# CONFIG_NFS_SWAP is not set
+CONFIG_PINCTRL_SUNXI=y
+CONFIG_PINCTRL_SUN20I_D1=y
+# CONFIG_VIRTIO_BLK is not set
+# CONFIG_MD is not set
+# CONFIG_VIRTIO_MENU is not set
diff --git a/board/mangopi-mq-d1s/overlay/boot/extlinux/extlinux.conf
b/board/mangopi-mq-d1s/overlay/boot/extlinux/extlinux.conf
new file mode 100644
index 0000000000..c825ad4667
--- /dev/null
+++ b/board/mangopi-mq-d1s/overlay/boot/extlinux/extlinux.conf
@@ -0,0 +1,4 @@ 
+label linux
+  kernel /boot/Image
+  # use devicetree from u-boot
+  append console=ttyS3,115200 root=/dev/mmcblk0p1 ro rootwait
diff --git a/board/mangopi-mq-d1s/overlay/etc/network/interfaces
b/board/mangopi-mq-d1s/overlay/etc/network/interfaces
new file mode 100644
index 0000000000..89e7d74aff
--- /dev/null
+++ b/board/mangopi-mq-d1s/overlay/etc/network/interfaces
@@ -0,0 +1,6 @@ 
+auto lo
+iface lo inet loopback
+
+auto wlan0
+iface wlan0 inet dhcp
+wpa-conf /etc/wpa_supplicant.conf
diff --git a/board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf
b/board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf
new file mode 100644
index 0000000000..b43292b0a7
--- /dev/null
+++ b/board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf
@@ -0,0 +1,8 @@ 
+ap_scan=1
+
+network={
+        ssid="YOURSSID"
+        scan_ssid=1
+        key_mgmt=WPA-PSK
+        psk="YOURPASSWD"
+}
diff --git a/board/mangopi-mq-d1s/readme.txt b/board/mangopi-mq-d1s/readme.txt
new file mode 100644
index 0000000000..60b148764e
--- /dev/null
+++ b/board/mangopi-mq-d1s/readme.txt
@@ -0,0 +1,48 @@ 
+MangoPi MQ D1s (RISC-V)
+=======================
+
+MangoPi MQ D1s (board model MQ1W) is a tiny (4x4cm) RISC-V based
single board computer. It's built around
+Allwinner D1s (also referred as F133) single core 1GHz CPU with
integrated 64MB DDR2 RAM.
+Board features:
+- USB-OTG Type-C socket
+- USB-HOST Type-C socket
+- 2x 22 pin GPIO headers
+- TF card slot
+- RTL8189FTV WiFi module with ext. antenna connector
+- 15 pin DSI FPC connector
+- 40 pin RGB FPC connector
+- 6 pin CTP FPC connector
+- 24 pin DVP FPC connector
+- onboard mic
+- onboard audio amplifier
+- FEL,reset button
+
+There is no HDMI connector.
+
+How to build
+============
+
+$ make mangopi_mq_d1s_defconfig
+$ make
+
+Wifi
+==========
+
+Edit  board/mangopi-mq-d1s/overlay/etc/wpa_supplicant.conf or
+/etc/wpa_supplicant.conf once connected to the board:
+
+* Replace YOURSSID with your AP ssid
+* Replace YOURPASSWD with your AP password
+
+How to write the SD card
+========================
+
+Once the build process is finished you will have an image called "sdcard.img"
+in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an SD card with "dd":
+
+  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Connect a TTL UART to the UART3 on P8 header (unpopulated), insert
the microSD card and
+plug in a USB-C cable to the OTG or HOST connector to boot the system.
diff --git a/board/mangopi-mq-d1s/uboot_board_defconfig
b/board/mangopi-mq-d1s/uboot_board_defconfig
new file mode 100644
index 0000000000..0a3d8ded01
--- /dev/null
+++ b/board/mangopi-mq-d1s/uboot_board_defconfig
@@ -0,0 +1,10 @@ 
+CONFIG_RISCV=y
+CONFIG_DEFAULT_DEVICE_TREE="sun20i-d1s-mangopi-mq"
+CONFIG_TARGET_SUN20I_D1=y
+CONFIG_ARCH_RV64I=y
+CONFIG_RISCV_SMODE=y
+# CONFIG_SPL_SMP is not set
+CONFIG_SYS_SPL_MALLOC=y
+CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS=0x0
+# CONFIG_SYS_I2C_MVTWSI is not set
+CONFIG_DM_REGULATOR_FIXED=y
diff --git a/configs/mangopi_mq_d1s_defconfig b/configs/mangopi_mq_d1s_defconfig
new file mode 100644
index 0000000000..0d2a3c40dd
--- /dev/null
+++ b/configs/mangopi_mq_d1s_defconfig
@@ -0,0 +1,47 @@ 
+BR2_riscv=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_ROOTFS_OVERLAY="board/mangopi-mq-d1s/overlay"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/mangopi-mq-d1s/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.8"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/mangopi-mq-d1s/linux.fragment"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun20i-d1s-mangopi-mq"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_PACKAGE_RTL8189FS=y
+BR2_PACKAGE_WIRELESS_TOOLS=y
+BR2_PACKAGE_WPA_SUPPLICANT=y
+BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
+BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
+BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
+BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
+BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
+BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_OPENSBI=y
+BR2_TARGET_OPENSBI_PLAT="generic"
+# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
+BR2_TARGET_OPENSBI_LATEST_VERSION=y
+# BR2_TARGET_OPENSBI_CUSTOM_VERSION is not set
+BR2_TARGET_OPENSBI_VERSION="1.3"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call
github,smaeul,u-boot,for-conor)/uboot-for-conor.tar.gz"
+# BR2_TARGET_UBOOT_USE_DEFCONFIG is not set
+BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="board/mangopi-mq-d1s/uboot_board_defconfig"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
+BR2_TARGET_UBOOT_NEEDS_OPENSBI=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"