qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Niek Linnenbank" <nieklinnenbank@gmail.com>,
	qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>
Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v3 17/17] docs: add Orange Pi PC document
Date: Sat, 18 Jan 2020 10:37:51 +0100	[thread overview]
Message-ID: <15d377a2-9d40-6195-5bfb-64e69037cd64@redhat.com> (raw)
In-Reply-To: <20200108200020.4745-18-nieklinnenbank@gmail.com>

On 1/8/20 9:00 PM, Niek Linnenbank wrote:
> The Xunlong Orange Pi PC machine is a functional ARM machine
> based on the Allwinner H3 System-on-Chip. It supports mainline
> Linux, U-Boot, NetBSD and is covered by acceptance tests.
> 
> This commit adds a documentation text file with a description
> of the machine and instructions for the user.
> 
> Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com>
> ---
>   docs/orangepi.rst | 200 ++++++++++++++++++++++++++++++++++++++++++++++
>   MAINTAINERS       |   1 +
>   2 files changed, 201 insertions(+)
>   create mode 100644 docs/orangepi.rst
> 
> diff --git a/docs/orangepi.rst b/docs/orangepi.rst
> new file mode 100644
> index 0000000000..5ac2a7b7cc
> --- /dev/null
> +++ b/docs/orangepi.rst
> @@ -0,0 +1,200 @@
> +=========================
> +Orange Pi PC Machine Type
> +=========================
> +
> +The Xunlong Orange Pi PC is an Allwinner H3 System on Chip
> +based embedded computer with mainline support in both U-Boot
> +and Linux. The board comes with a Quad Core Cortex A7 @ 1.3GHz,
> +512MB RAM, 100Mbit ethernet, USB, SD/MMC, USB, HDMI and
> +various other I/O.
> +
> +Supported devices
> +-----------------
> +
> +The Orange Pi PC machine type supports the following devices:

Maybe drop "type"?

> +
> + * SMP (Quad Core Cortex A7)
> + * Generic Interrupt Controller configuration
> + * SRAM mappings
> + * SDRAM controller
> + * Real Time Clock
> + * Timer device (re-used from Allwinner A10)
> + * UART
> + * SD/MMC storage controller
> + * EMAC ethernet connectivity

Drop "connectivity"?

> + * USB 2.0 interfaces
> + * Clock Control Unit
> + * System Control module
> + * Security Identifier device
> +
> +Limitations
> +-----------
> +
> +Currently, Orange Pi PC does *not* support the following features:
> +
> +- Graphical output via HDMI, GPU and/or the Display Engine
> +- Audio output
> +- Hardware Watchdog
> +
> +Also see the 'unimplemented' array in the Allwinner H3 SoC module
> +for a complete list of unimplemented I/O devices:
> +  ./hw/arm/allwinner-h3.c
> +
> +Using the Orange Pi PC machine type
> +-----------------------------------
> +
> +Boot options
> +~~~~~~~~~~~~
> +
> +The Orange Pi PC machine can start using the standard -kernel functionality
> +for loading a Linux kernel or ELF executable. Additionally, the Orange Pi PC
> +machine can also emulate the BootROM which is present on an actual Allwinner H3
> +based SoC, which loads the bootloader from SD card, specified via the -sd argument

"from a SD card"?

> +to qemu-system-arm.
> +
> +Running mainline Linux
> +~~~~~~~~~~~~~~~~~~~~~~
> +
> +Recently released mainline Linux kernels from 4.19 up to latest master

Drop "Recently released mainline" or only use "Mainline"?

> +are known to work. To build a Linux mainline kernel that can be booted
> +by the Orange Pi PC machine, simply configure the kernel using the
> +sunxi_defconfig configuration:
> +
> +  $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make mrproper
> +  $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make sunxi_defconfig
> +
> +To be able to use USB storage, you need to manually enable the corresponding
> +configuration item. Start the kconfig configuration tool:
> +
> +  $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make menuconfig
> +
> +Navigate to the following item, enable it and save your configuration:
> +
> +  Device Drivers > USB support > USB Mass Storage support

Isn't it simpler to run 'echo CONFIG_USB_STORAGE=y >> .config && make 
oldconfig'?

> +
> +Build the Linux kernel with:
> +
> +  $ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make -j5

I'm not sure about recommending "-j5" in the doc, not all user have >=4 
SMP system. Maybe we don't care.

> +
> +To boot the newly build linux kernel in QEMU with the Orange Pi PC machine, use:
> +
> +  $ qemu-system-arm -M orangepi-pc -nic user -nographic \
> +      -kernel /path/to/linux/arch/arm/boot/zImage \
> +      -append 'console=ttyS0,115200' \
> +      -dtb /path/to/linux/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb
> +
> +Orange Pi PC images
> +~~~~~~~~~~~~~~~~~~~
> +
> +Note that the mainline kernel does not have a root filesystem. You may provide it
> +with an official Orange Pi PC image from the official website:
> +
> +  http://www.orangepi.org/downloadresources/
> +
> +Another possibility is to run an Armbian image for Orange Pi PC which
> +can be downloaded from:
> +
> +   https://www.armbian.com/orange-pi-pc/
> +
> +Alternatively, you can also choose to build you own image with buildroot
> +using the orangepi_pc_defconfig. Also see https://buildroot.org for more information.
> +
> +You can choose to attach the selected image either as an SD card or as USB mass storage.
> +For example, to boot using the Orange Pi PC Debian image on SD card, simply add the -sd
> +argument and provide the proper root= kernel parameter:
> +
> +  $ qemu-system-arm -M orangepi-pc -nic user -nographic \
> +      -kernel /path/to/linux/arch/arm/boot/zImage \
> +      -append 'console=ttyS0,115200 root=/dev/mmcblk0p2' \
> +      -dtb /path/to/linux/arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb \
> +      -sd OrangePi_pc_debian_stretch_server_linux5.3.5_v1.0.img
> +
> +To attach the image as an USB mass storage device to the machine,
> +simply append to the command:
> +
> +  -drive if=none,id=stick,file=myimage.img \
> +  -device usb-storage,bus=usb-bus.0,drive=stick
> +
> +Instead of providing a custom Linux kernel via the -kernel command you may also
> +choose to let the Orange Pi PC machine load the bootloader from SD card, just like
> +a real board would do using the BootROM. Simply pass the selected image via the -sd
> +argument and remove the -kernel, -append, -dbt and -initrd arguments:
> +
> +  $ qemu-system-arm -M orangepi-pc -nic user -nographic \
> +       -sd Armbian_19.11.3_Orangepipc_buster_current_5.3.9.img
> +
> +Note that both the official Orange Pi PC images and Armbian images start
> +a lot of userland programs via systemd. Depending on the host hardware and OS,
> +they may be slow to emulate, especially due to emulating the 4 cores.
> +To help reduce the performance slow down due to emulating the 4 cores, you can
> +give the following kernel parameters (or via -append):
> +
> +  => setenv extraargs 'systemd.default_timeout_start_sec=9000 loglevel=7 nosmp console=ttyS0,115200'
> +
> +Running U-Boot
> +~~~~~~~~~~~~~~
> +
> +U-Boot mainline can be build and configured using the orangepi_pc_defconfig
> +using similar commands as describe above for Linux. Note that it is recommended
> +for development/testing to select the following configuration setting in U-Boot:
> +
> +  Device Tree Control > Provider for DTB for DT Control > Embedded DTB
> +
> +To start U-Boot using the Orange Pi PC machine, provide the
> +u-boot binary to the -kernel argument:
> +
> +  $ qemu-system-arm -M orangepi-pc -nic user -nographic \
> +      -kernel /path/to/uboot/u-boot -sd disk.img
> +
> +Use the following U-boot commands to load and boot a Linux kernel from SD card:
> +
> +  -> setenv bootargs console=ttyS0,115200
> +  -> ext2load mmc 0 0x42000000 zImage
> +  -> ext2load mmc 0 0x43000000 sun8i-h3-orangepi-pc.dtb
> +  -> bootz 0x42000000 - 0x43000000
> +
> +Running NetBSD
> +~~~~~~~~~~~~~~
> +
> +The NetBSD operating system also includes support for Allwinner H3 based boards,
> +including the Orange Pi PC. NetBSD 9.0 is known to work best for the Orange Pi PC
> +board and provides a fully working system with serial console, networking and storage.
> +
> +Currently NetBSD 9.0 is in testing, but release candidate 1 can be started
> +successfully on the Orange Pi PC machine. Get the 'evbarm-earmv7hf' based image from:
> +
> +  https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.0_RC1/evbarm-earmv7hf/binary/gzimg/armv7.img.gz
> +
> +The image requires manually installing U-Boot in the image. Build U-Boot with
> +the orangepi_pc_defconfig configuration as described in the previous section.
> +Next, unzip the NetBSD image and write the U-Boot binary including SPL using:
> +
> +  $ gunzip armv7.img.gz
> +  $ dd if=/path/to/u-boot-sunxi-with-spl.bin of=armv7.img bs=1024 seek=8 conv=notrunc
> +
> +Start the machine using the following command:
> +
> +  $ qemu-system-arm -M orangepi-pc -nic user -nographic \
> +        -sd armv7.img
> +
> +At the U-Boot stage, interrupt the automatic boot process by pressing a key
> +and set the following environment variables before booting:
> +
> +  => setenv bootargs root=ld0a
> +  => setenv kernel netbsd-GENERIC.ub
> +  => setenv fdtfile dtb/sun8i-h3-orangepi-pc.dtb
> +  => setenv bootcmd 'fatload mmc 0:1 ${kernel_addr_r} ${kernel}; fatload mmc 0:1 ${fdt_addr_r} ${fdtfile}; fdt addr ${fdt_addr_r}; bootm ${kernel_addr_r} - ${fdt_addr_r}'
> +
> +Optionally you may save the environment variables to SD card with 'saveenv'.
> +To continue booting simply give the 'boot' command and NetBSD boots.
> +
> +Orange Pi PC acceptance tests
> +-----------------------------
> +
> +The Orange Pi PC machine has several acceptance tests included.
> +To run the whole set of tests, build QEMU from source and simply
> +provide the following command:
> +
> +  $ AVOCADO_ALLOW_LARGE_STORAGE=yes avocado --show=app,console run \
> +     -t machine:orangepi-pc tests/acceptance/boot_linux_console.py
> +
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 6e1b92b5fa..b52ac2fb9e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -488,6 +488,7 @@ S: Maintained
>   F: hw/*/allwinner-h3*
>   F: include/hw/*/allwinner-h3*
>   F: hw/arm/orangepi.c
> +F: docs/orangepi.rst
>   
>   ARM PrimeCell and CMSDK devices
>   M: Peter Maydell <peter.maydell@linaro.org>
> 



  reply	other threads:[~2020-01-18  9:39 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 20:00 [PATCH v3 00/17] Add Allwinner H3 SoC and Orange Pi PC Machine Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 01/17] hw/arm: add Allwinner H3 System-on-Chip Niek Linnenbank
2020-01-08 23:13   ` Philippe Mathieu-Daudé
2020-01-11 20:45     ` Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 02/17] hw/arm: add Xunlong Orange Pi PC machine Niek Linnenbank
2020-01-08 22:44   ` Philippe Mathieu-Daudé
2020-01-10 21:20     ` Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 03/17] hw/arm/allwinner-h3: add Clock Control Unit Niek Linnenbank
2020-01-13 19:18   ` Niek Linnenbank
2020-01-18 15:37     ` Philippe Mathieu-Daudé
2020-01-18 23:28       ` Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 04/17] hw/arm/allwinner-h3: add USB host controller Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 05/17] hw/arm/allwinner-h3: add System Control module Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 06/17] hw/arm/allwinner: add CPU Configuration module Niek Linnenbank
2020-01-13 23:14   ` Philippe Mathieu-Daudé
2020-01-14 23:04     ` Niek Linnenbank
2020-01-18  9:06       ` Philippe Mathieu-Daudé
2020-01-18 22:17         ` Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 07/17] hw/arm/allwinner: add Security Identifier device Niek Linnenbank
2020-01-18 15:25   ` Philippe Mathieu-Daudé
2020-01-20 17:59     ` Corey Minyard
2020-02-02 21:27       ` Niek Linnenbank
2020-02-03 13:10         ` Corey Minyard
2020-02-06 21:09           ` Niek Linnenbank
2020-02-12 21:31             ` Niek Linnenbank
2020-02-12 22:47               ` Philippe Mathieu-Daudé
2020-02-17 19:34                 ` Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 08/17] hw/arm/allwinner: add SD/MMC host controller Niek Linnenbank
2020-01-18 15:39   ` Philippe Mathieu-Daudé
2020-01-08 20:00 ` [PATCH v3 09/17] hw/arm/allwinner-h3: add EMAC ethernet device Niek Linnenbank
2020-01-18 15:17   ` Philippe Mathieu-Daudé
2020-01-08 20:00 ` [PATCH v3 10/17] hw/arm/allwinner-h3: add Boot ROM support Niek Linnenbank
2020-01-13 23:28   ` Philippe Mathieu-Daudé
2020-01-14 23:10     ` Niek Linnenbank
2020-01-18  9:09       ` Philippe Mathieu-Daudé
2020-01-18 22:28         ` Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 11/17] hw/arm/allwinner-h3: add SDRAM controller device Niek Linnenbank
2020-01-18 15:22   ` Philippe Mathieu-Daudé
2020-01-08 20:00 ` [PATCH v3 12/17] hw/arm/allwinner: add RTC device support Niek Linnenbank
2020-01-13 22:57   ` Philippe Mathieu-Daudé
2020-01-14 22:52     ` Niek Linnenbank
2020-01-14 22:57       ` Niek Linnenbank
2020-01-18 15:05         ` Philippe Mathieu-Daudé
2020-01-18 22:52           ` Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 13/17] tests/boot_linux_console: Add a quick test for the OrangePi PC board Niek Linnenbank
2020-01-18 11:22   ` Philippe Mathieu-Daudé
2020-01-18 23:04     ` Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 14/17] tests/boot_linux_console: Add initrd test for the Orange Pi " Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 15/17] tests/boot_linux_console: Add a SD card test for the OrangePi " Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 16/17] tests/boot_linux_console: Add a SLOW test booting Ubuntu on OrangePi PC Niek Linnenbank
2020-01-08 20:00 ` [PATCH v3 17/17] docs: add Orange Pi PC document Niek Linnenbank
2020-01-18  9:37   ` Philippe Mathieu-Daudé [this message]
2020-01-18 22:38     ` Niek Linnenbank

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15d377a2-9d40-6195-5bfb-64e69037cd64@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=nieklinnenbank@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).