Re: [PATCH 30/33] doc: boards: amlogic: add documentation for BananaPi CM4IO

2023-03-20 Thread Christian Hewitt


> On 20 Mar 2023, at 4:13 pm, Neil Armstrong  wrote:
> 
> On 20/03/2023 12:46, Christian Hewitt wrote:
>> Add build instructions for the BananaPi BPI-CM4IO carrier board with
>> BPI-CM4 module.
>> Signed-off-by: Christian Hewitt 
>> ---
>>  board/amlogic/u200/MAINTAINERS   |   1 -
>>  board/amlogic/w400/MAINTAINERS   |   2 +
>>  doc/board/amlogic/bananapi-cm4io.rst | 152 +++
>>  doc/board/amlogic/index.rst  |   1 +
>>  4 files changed, 155 insertions(+), 1 deletion(-)
>>  create mode 100644 doc/board/amlogic/bananapi-cm4io.rst
> 
> 
> 
>> +
>> +U-Boot Signing with Pre-Built FIP repo
>> +--
>> +
>> +.. code-block:: bash
>> +$ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
>> +$ cd amlogic-boot-fip
>> +$ mkdir my-output-dir
>> +$ ./build-fip.sh bananapi-cm4io /path/to/u-boot/u-boot.bin my-output-dir
> 
> 
> This should be bananapi-m2s since the same is used, or we should duplicate it 
> for cm4io/cm4.

https://github.com/LibreELEC/amlogic-boot-fip/tree/master/bananapi-cm4io

^ It’s the same FIPs that were submitted for M2S but for packaging
reasons I cloned them (users struggle to find images not explicitly
named for their board). I’ll submit patches for the M2S and M2-Pro
boards once this series is accepted (hopefully).

Christian

[PATCH 30/33] doc: boards: amlogic: add documentation for BananaPi CM4IO

2023-03-20 Thread Christian Hewitt
Add build instructions for the BananaPi BPI-CM4IO carrier board with
BPI-CM4 module.

Signed-off-by: Christian Hewitt 
---
 board/amlogic/u200/MAINTAINERS   |   1 -
 board/amlogic/w400/MAINTAINERS   |   2 +
 doc/board/amlogic/bananapi-cm4io.rst | 152 +++
 doc/board/amlogic/index.rst  |   1 +
 4 files changed, 155 insertions(+), 1 deletion(-)
 create mode 100644 doc/board/amlogic/bananapi-cm4io.rst

diff --git a/board/amlogic/u200/MAINTAINERS b/board/amlogic/u200/MAINTAINERS
index 7535e489d1..47cec234a1 100644
--- a/board/amlogic/u200/MAINTAINERS
+++ b/board/amlogic/u200/MAINTAINERS
@@ -4,7 +4,6 @@ S:  Maintained
 L: u-boot-amlo...@groups.io
 F: board/amlogic/u200/
 F: configs/u200_defconfig
-F: configs/bananapi-cm4-cm4io_defconfig
 F: configs/bananapi-m5_defconfig
 F: configs/radxa-zero_defconfig
 F: doc/board/amlogic/u200.rst
diff --git a/board/amlogic/w400/MAINTAINERS b/board/amlogic/w400/MAINTAINERS
index 96ccda2001..26a4c2c587 100644
--- a/board/amlogic/w400/MAINTAINERS
+++ b/board/amlogic/w400/MAINTAINERS
@@ -3,4 +3,6 @@ M:  Neil Armstrong 
 S: Maintained
 L: u-boot-amlo...@groups.io
 F: board/amlogic/w400/
+F: configs/bananapi-cm4-cm4io_defconfig
 F: doc/board/amlogic/w400.rst
+F: doc/board/amlogic/bananapi-cm4io.rst
diff --git a/doc/board/amlogic/bananapi-cm4io.rst 
b/doc/board/amlogic/bananapi-cm4io.rst
new file mode 100644
index 00..aabe2ef197
--- /dev/null
+++ b/doc/board/amlogic/bananapi-cm4io.rst
@@ -0,0 +1,152 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+U-Boot for BananaPi CM4 with CM4IO (A311D)
+==
+
+BPI-CM4 is a system-on-module board manufactured by Sinovoip. It follows the 
Raspberry Pi
+CM4 interface specification but with a single HDMI port and a single DSI 
output:
+
+ - Amlogic A311D Arm Cortex-A53 dual-core + Cortex-A73 quad-core SoC 
+ - 4GB DDR4 SDRAM
+ - 16GB eMMC
+ - NPU
+ - HDMI 2.1 display
+ - Gigabit Ethernet
+ - RTL8822CS WiFi (a/b/g/n/ac) + BT 5.0
+
+BPI-CM4IO is a carrier board for the BPI-CM4 module with the following 
specification:
+
+ - CM4 interface
+ - HDMI interface
+ - MIPI CSI interface
+ - MIPI DSI interface
+ - Ethernet interface
+ - PCIe interface
+ - SD (micro)
+ - SIM (micro)
+ - 26-pin GPIO
+ - UART serial
+ - 1x USB-C (power)
+ - 2x USB 2.0
+
+Schematics are available from the manufacturer: 
https://wiki.banana-pi.org/Banana_Pi_BPI-CM4
+
+U-Boot Compilation
+--
+
+.. code-block:: bash
+
+$ export CROSS_COMPILE=aarch64-none-elf-
+$ make bananapi-cm4io_defconfig
+$ make
+
+U-Boot Signing with Pre-Built FIP repo
+--
+
+.. code-block:: bash
+$ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
+$ cd amlogic-boot-fip
+$ mkdir my-output-dir
+$ ./build-fip.sh bananapi-cm4io /path/to/u-boot/u-boot.bin my-output-dir
+
+U-Boot Manual Signing
+-
+
+Amlogic does not provide sources for the firmware and tools needed to create a 
bootloader
+image so it is necessary to obtain binaries from sources published by the 
board vendor:
+
+.. code-block:: bash
+
+$ wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+$ wget 
https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+$ tar xvfJ gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.xz
+$ tar xvfJ gcc-linaro-arm-none-eabi-4.8-2013.11_linux.tar.xz
+$ export 
PATH=$PWD/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin:$PWD/gcc-linaro-arm-none-eabi-4.8-2013.11_linux/bin:$PATH
+
+$ DIR=bananapi-cm4io
+$ git clone --depth 1 https://github.com/Dangku/amlogic-u-boot.git -b 
khadas-g12b-v2015.01-m2s $DIR
+
+$ cd $DIR
+$ make bananapi_cm4_defconfig
+$ make
+$ export UBDIR=$PWD
+
+Go back to the mainline U-Boot source tree then:
+
+.. code-block:: bash
+
+$ mkdir fip
+
+$ wget 
https://github.com/BayLibre/u-boot/releases/download/v2017.11-libretech-cc/blx_fix_g12a.sh
 -O fip/blx_fix.sh
+$ cp $UBDIR/build/scp_task/bl301.bin fip/
+$ cp $UBDIR/build/board/bananapi/bananpi_cm4/firmware/acs.bin fip/
+$ cp $UBDIR/fip/g12a/bl2.bin fip/
+$ cp $UBDIR/fip/g12a/bl30.bin fip/
+$ cp $UBDIR/fip/g12a/bl31.img fip/
+$ cp $UBDIR/fip/g12a/ddr3_1d.fw fip/
+$ cp $UBDIR/fip/g12a/ddr4_1d.fw fip/
+$ cp $UBDIR/fip/g12a/ddr4_2d.fw fip/
+$ cp $UBDIR/fip/g12a/diag_lpddr4.fw fip/
+$ cp $UBDIR/fip/g12a/lpddr3_1d.fw fip/
+$ cp $UBDIR/fip/g12a/lpddr4_1d.fw fip/
+$ cp $UBDIR/fip/g12a/lpddr4_2d.fw fip/
+$ cp $UBDIR/fip/g12a/piei.fw fip/
+$ cp $UBDIR/fip/g12a/aml_ddr.fw fip/
+$ cp u-boot.bin fip/bl33.bin
+
+$ sh fip/blx_fix.sh \
+ fip/bl30.bin \
+ fip/zero_tmp \
+ fip/bl30_zero.bin \
+ fip/bl301.bin \
+ fip/bl30

Re: [PATCH 30/33] doc: boards: amlogic: add documentation for BananaPi CM4IO

2023-03-20 Thread neil . armstrong

On 20/03/2023 13:23, Christian Hewitt wrote:



On 20 Mar 2023, at 4:13 pm, Neil Armstrong  wrote:

On 20/03/2023 12:46, Christian Hewitt wrote:

Add build instructions for the BananaPi BPI-CM4IO carrier board with
BPI-CM4 module.
Signed-off-by: Christian Hewitt 
---
  board/amlogic/u200/MAINTAINERS   |   1 -
  board/amlogic/w400/MAINTAINERS   |   2 +
  doc/board/amlogic/bananapi-cm4io.rst | 152 +++
  doc/board/amlogic/index.rst  |   1 +
  4 files changed, 155 insertions(+), 1 deletion(-)
  create mode 100644 doc/board/amlogic/bananapi-cm4io.rst





+
+U-Boot Signing with Pre-Built FIP repo
+--
+
+.. code-block:: bash
+$ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
+$ cd amlogic-boot-fip
+$ mkdir my-output-dir
+$ ./build-fip.sh bananapi-cm4io /path/to/u-boot/u-boot.bin my-output-dir



This should be bananapi-m2s since the same is used, or we should duplicate it 
for cm4io/cm4.


https://github.com/LibreELEC/amlogic-boot-fip/tree/master/bananapi-cm4io

^ It’s the same FIPs that were submitted for M2S but for packaging
reasons I cloned them (users struggle to find images not explicitly
named for their board). I’ll submit patches for the M2S and M2-Pro
boards once this series is accepted (hopefully).


Ack, so no changes needed then !



Christian




Re: [PATCH 30/33] doc: boards: amlogic: add documentation for BananaPi CM4IO

2023-03-20 Thread Neil Armstrong

On 20/03/2023 12:46, Christian Hewitt wrote:

Add build instructions for the BananaPi BPI-CM4IO carrier board with
BPI-CM4 module.

Signed-off-by: Christian Hewitt 
---
  board/amlogic/u200/MAINTAINERS   |   1 -
  board/amlogic/w400/MAINTAINERS   |   2 +
  doc/board/amlogic/bananapi-cm4io.rst | 152 +++
  doc/board/amlogic/index.rst  |   1 +
  4 files changed, 155 insertions(+), 1 deletion(-)
  create mode 100644 doc/board/amlogic/bananapi-cm4io.rst






+
+U-Boot Signing with Pre-Built FIP repo
+--
+
+.. code-block:: bash
+$ git clone https://github.com/LibreELEC/amlogic-boot-fip --depth=1
+$ cd amlogic-boot-fip
+$ mkdir my-output-dir
+$ ./build-fip.sh bananapi-cm4io /path/to/u-boot/u-boot.bin my-output-dir



This should be bananapi-m2s since the same is used, or we should duplicate it 
for cm4io/cm4.

Neil