Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2023-09-10 Thread Simon Glass
Hi Sumit,

On Tue, 29 Aug 2023 at 04:24, Sumit Garg  wrote:
>
> Hi Simon,
>
> On Tue, 29 Aug 2023 at 03:39, Simon Glass  wrote:
> >
> > Hi Peter,
> >
> > On Mon, 28 Aug 2023 at 14:24, Peter Robinson  wrote:
> > >
> > > On Mon, Aug 28, 2023 at 6:55 PM Simon Glass  wrote:
> > > >
> > > > Hi Sumit,
> > > >
> > > > On Thu, 24 Aug 2023 at 04:44, Sumit Garg  wrote:
> > > > >
> > > > > Hi Simon,
> > > > >
> > > > > On Thu, 24 Aug 2023 at 05:29, Simon Glass  wrote:
> > > > > >
> > > > > > Hi Sumit,
> > > > > >
> > > > > > On Tue, 12 Jul 2022 at 01:12, Sumit Garg  
> > > > > > wrote:
> > > > > > >
> > > > > > > Add support for 96Boards Dragonboard 845C aka Robotics RB3 
> > > > > > > development
> > > > > > > platform. This board complies with 96Boards Open Platform 
> > > > > > > Specifications.
> > > > > > >
> > > > > > > Features:
> > > > > > > - Qualcomm Snapdragon SDA845 SoC
> > > > > > > - 4GiB RAM
> > > > > > > - 64GiB UFS drive
> > > > > > >
> > > > > > > U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
> > > > > > > For detailed build and boot instructions, refer to
> > > > > > > doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
> > > > > > >
> > > > > > > Signed-off-by: Sumit Garg 
> > > > > > > Reviewed-by: Ramon Fried 
> > > > > > > ---
> > > > > > >  arch/arm/dts/dragonboard845c-uboot.dtsi   |  37 +++
> > > > > > >  arch/arm/dts/dragonboard845c.dts  |  44 
> > > > > > >  arch/arm/mach-snapdragon/Kconfig  |  14 +++
> > > > > > >  board/qualcomm/dragonboard845c/Kconfig|  12 +++
> > > > > > >  board/qualcomm/dragonboard845c/MAINTAINERS|   6 ++
> > > > > > >  board/qualcomm/dragonboard845c/Makefile   |   9 ++
> > > > > > >  board/qualcomm/dragonboard845c/db845c.its |  63 +++
> > > > > > >  .../dragonboard845c/dragonboard845c.c |   9 ++
> > > > > > >  configs/dragonboard845c_defconfig |  28 +
> > > > > > >  doc/board/qualcomm/sdm845.rst | 100 
> > > > > > > +++---
> > > > > > >  include/configs/dragonboard845c.h |  28 +
> > > > > > >  11 files changed, 337 insertions(+), 13 deletions(-)
> > > > > > >  create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi
> > > > > > >  create mode 100644 arch/arm/dts/dragonboard845c.dts
> > > > > > >  create mode 100644 board/qualcomm/dragonboard845c/Kconfig
> > > > > > >  create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS
> > > > > > >  create mode 100644 board/qualcomm/dragonboard845c/Makefile
> > > > > > >  create mode 100644 board/qualcomm/dragonboard845c/db845c.its
> > > > > > >  create mode 100644 
> > > > > > > board/qualcomm/dragonboard845c/dragonboard845c.c
> > > > > > >  create mode 100644 configs/dragonboard845c_defconfig
> > > > > > >  create mode 100644 include/configs/dragonboard845c.h
> > > > > > >
> > > > > > [..]
> > > > > >
> > > > > > > diff --git a/doc/board/qualcomm/sdm845.rst 
> > > > > > > b/doc/board/qualcomm/sdm845.rst
> > > > > > > index b6642c9579..8ef4749287 100644
> > > > > > > --- a/doc/board/qualcomm/sdm845.rst
> > > > > > > +++ b/doc/board/qualcomm/sdm845.rst
> > > > > > > @@ -35,9 +35,25 @@ Pack android boot image
> > > > > > >  ^^^
> > > > > > >  We'll assemble android boot image with ``u-boot.bin`` instead of 
> > > > > > > linux kernel,
> > > > > > >  and FIT image instead of ``initramfs``. Android bootloader 
> > > > > > > expect gzipped kernel
> > > > > > > -with appended dtb, so let's mimic linux to satisfy stock 
> > > > > > > bootloader:
> > > > > > > +with appended dtb, so let's mimic linux to satisfy stock 
> > > > > > > bootloader.
> > > > > > >
> > > > > >
> > > > > > [..]
> > > > > >
> > > > > > > +The dragonboard845c is a Qualcomm Robotics RB3 Development 
> > > > > > > Platform, based on
> > > > > > > +the Qualcomm SDM845 SoC.
> > > > > > > +
> > > > > > > +Steps:
> > > > > > > +
> > > > > > > +- Build u-boot::
> > > > > > > +
> > > > > > > +   $ export CROSS_COMPILE=
> > > > > > > +   $ make dragonboard845c_defconfig
> > > > > > > +   $ make
> > > > > > > +
> > > > > > > +- Create dummy dtb::
> > > > > > > +
> > > > > > > +   workdir=/tmp/prepare_payload
> > > > > > > +   mkdir -p "$workdir"
> > > > > > > +   mock_dtb="$workdir"/payload_mock.dtb
> > > > > > > +
> > > > > > > +   dtc -I dts -O dtb -o "$mock_dtb" << EOF
> > > > > > > +   /dts-v1/;
> > > > > > > +   / {
> > > > > > > +   #address-cells = <2>;
> > > > > > > +   #size-cells = <2>;
> > > > > > > +
> > > > > > > +   memory@8000 {
> > > > > > > +   device_type = "memory";
> > > > > > > +   /* We expect the bootloader to fill in 
> > > > > > > the size */
> > > > > > > +   reg = <0 0x8000 0 0>;
> > > > > > > +   };
> > > > > > > +
> > > > > > > +   chosen { };
> > > > > > > +   };
> > > > > > > +   EOF
> > > 

Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2023-08-29 Thread Sumit Garg
Hi Simon,

On Tue, 29 Aug 2023 at 03:39, Simon Glass  wrote:
>
> Hi Peter,
>
> On Mon, 28 Aug 2023 at 14:24, Peter Robinson  wrote:
> >
> > On Mon, Aug 28, 2023 at 6:55 PM Simon Glass  wrote:
> > >
> > > Hi Sumit,
> > >
> > > On Thu, 24 Aug 2023 at 04:44, Sumit Garg  wrote:
> > > >
> > > > Hi Simon,
> > > >
> > > > On Thu, 24 Aug 2023 at 05:29, Simon Glass  wrote:
> > > > >
> > > > > Hi Sumit,
> > > > >
> > > > > On Tue, 12 Jul 2022 at 01:12, Sumit Garg  
> > > > > wrote:
> > > > > >
> > > > > > Add support for 96Boards Dragonboard 845C aka Robotics RB3 
> > > > > > development
> > > > > > platform. This board complies with 96Boards Open Platform 
> > > > > > Specifications.
> > > > > >
> > > > > > Features:
> > > > > > - Qualcomm Snapdragon SDA845 SoC
> > > > > > - 4GiB RAM
> > > > > > - 64GiB UFS drive
> > > > > >
> > > > > > U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
> > > > > > For detailed build and boot instructions, refer to
> > > > > > doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
> > > > > >
> > > > > > Signed-off-by: Sumit Garg 
> > > > > > Reviewed-by: Ramon Fried 
> > > > > > ---
> > > > > >  arch/arm/dts/dragonboard845c-uboot.dtsi   |  37 +++
> > > > > >  arch/arm/dts/dragonboard845c.dts  |  44 
> > > > > >  arch/arm/mach-snapdragon/Kconfig  |  14 +++
> > > > > >  board/qualcomm/dragonboard845c/Kconfig|  12 +++
> > > > > >  board/qualcomm/dragonboard845c/MAINTAINERS|   6 ++
> > > > > >  board/qualcomm/dragonboard845c/Makefile   |   9 ++
> > > > > >  board/qualcomm/dragonboard845c/db845c.its |  63 +++
> > > > > >  .../dragonboard845c/dragonboard845c.c |   9 ++
> > > > > >  configs/dragonboard845c_defconfig |  28 +
> > > > > >  doc/board/qualcomm/sdm845.rst | 100 
> > > > > > +++---
> > > > > >  include/configs/dragonboard845c.h |  28 +
> > > > > >  11 files changed, 337 insertions(+), 13 deletions(-)
> > > > > >  create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi
> > > > > >  create mode 100644 arch/arm/dts/dragonboard845c.dts
> > > > > >  create mode 100644 board/qualcomm/dragonboard845c/Kconfig
> > > > > >  create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS
> > > > > >  create mode 100644 board/qualcomm/dragonboard845c/Makefile
> > > > > >  create mode 100644 board/qualcomm/dragonboard845c/db845c.its
> > > > > >  create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c
> > > > > >  create mode 100644 configs/dragonboard845c_defconfig
> > > > > >  create mode 100644 include/configs/dragonboard845c.h
> > > > > >
> > > > > [..]
> > > > >
> > > > > > diff --git a/doc/board/qualcomm/sdm845.rst 
> > > > > > b/doc/board/qualcomm/sdm845.rst
> > > > > > index b6642c9579..8ef4749287 100644
> > > > > > --- a/doc/board/qualcomm/sdm845.rst
> > > > > > +++ b/doc/board/qualcomm/sdm845.rst
> > > > > > @@ -35,9 +35,25 @@ Pack android boot image
> > > > > >  ^^^
> > > > > >  We'll assemble android boot image with ``u-boot.bin`` instead of 
> > > > > > linux kernel,
> > > > > >  and FIT image instead of ``initramfs``. Android bootloader expect 
> > > > > > gzipped kernel
> > > > > > -with appended dtb, so let's mimic linux to satisfy stock 
> > > > > > bootloader:
> > > > > > +with appended dtb, so let's mimic linux to satisfy stock 
> > > > > > bootloader.
> > > > > >
> > > > >
> > > > > [..]
> > > > >
> > > > > > +The dragonboard845c is a Qualcomm Robotics RB3 Development 
> > > > > > Platform, based on
> > > > > > +the Qualcomm SDM845 SoC.
> > > > > > +
> > > > > > +Steps:
> > > > > > +
> > > > > > +- Build u-boot::
> > > > > > +
> > > > > > +   $ export CROSS_COMPILE=
> > > > > > +   $ make dragonboard845c_defconfig
> > > > > > +   $ make
> > > > > > +
> > > > > > +- Create dummy dtb::
> > > > > > +
> > > > > > +   workdir=/tmp/prepare_payload
> > > > > > +   mkdir -p "$workdir"
> > > > > > +   mock_dtb="$workdir"/payload_mock.dtb
> > > > > > +
> > > > > > +   dtc -I dts -O dtb -o "$mock_dtb" << EOF
> > > > > > +   /dts-v1/;
> > > > > > +   / {
> > > > > > +   #address-cells = <2>;
> > > > > > +   #size-cells = <2>;
> > > > > > +
> > > > > > +   memory@8000 {
> > > > > > +   device_type = "memory";
> > > > > > +   /* We expect the bootloader to fill in the 
> > > > > > size */
> > > > > > +   reg = <0 0x8000 0 0>;
> > > > > > +   };
> > > > > > +
> > > > > > +   chosen { };
> > > > > > +   };
> > > > > > +   EOF
> > > > > > +
> > > > > > +- gzip u-boot::
> > > > > > +
> > > > > > +   gzip u-boot.bin
> > > > > > +
> > > > > > +- Append dtb to gzipped u-boot::
> > > > > > +
> > > > > > +cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
> > > > > > +
> > > > > > +- A ``db845c.its`` file can be found in 
> > > > > > 

Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2023-08-28 Thread Simon Glass
Hi Peter,

On Mon, 28 Aug 2023 at 14:24, Peter Robinson  wrote:
>
> On Mon, Aug 28, 2023 at 6:55 PM Simon Glass  wrote:
> >
> > Hi Sumit,
> >
> > On Thu, 24 Aug 2023 at 04:44, Sumit Garg  wrote:
> > >
> > > Hi Simon,
> > >
> > > On Thu, 24 Aug 2023 at 05:29, Simon Glass  wrote:
> > > >
> > > > Hi Sumit,
> > > >
> > > > On Tue, 12 Jul 2022 at 01:12, Sumit Garg  wrote:
> > > > >
> > > > > Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
> > > > > platform. This board complies with 96Boards Open Platform 
> > > > > Specifications.
> > > > >
> > > > > Features:
> > > > > - Qualcomm Snapdragon SDA845 SoC
> > > > > - 4GiB RAM
> > > > > - 64GiB UFS drive
> > > > >
> > > > > U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
> > > > > For detailed build and boot instructions, refer to
> > > > > doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
> > > > >
> > > > > Signed-off-by: Sumit Garg 
> > > > > Reviewed-by: Ramon Fried 
> > > > > ---
> > > > >  arch/arm/dts/dragonboard845c-uboot.dtsi   |  37 +++
> > > > >  arch/arm/dts/dragonboard845c.dts  |  44 
> > > > >  arch/arm/mach-snapdragon/Kconfig  |  14 +++
> > > > >  board/qualcomm/dragonboard845c/Kconfig|  12 +++
> > > > >  board/qualcomm/dragonboard845c/MAINTAINERS|   6 ++
> > > > >  board/qualcomm/dragonboard845c/Makefile   |   9 ++
> > > > >  board/qualcomm/dragonboard845c/db845c.its |  63 +++
> > > > >  .../dragonboard845c/dragonboard845c.c |   9 ++
> > > > >  configs/dragonboard845c_defconfig |  28 +
> > > > >  doc/board/qualcomm/sdm845.rst | 100 
> > > > > +++---
> > > > >  include/configs/dragonboard845c.h |  28 +
> > > > >  11 files changed, 337 insertions(+), 13 deletions(-)
> > > > >  create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi
> > > > >  create mode 100644 arch/arm/dts/dragonboard845c.dts
> > > > >  create mode 100644 board/qualcomm/dragonboard845c/Kconfig
> > > > >  create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS
> > > > >  create mode 100644 board/qualcomm/dragonboard845c/Makefile
> > > > >  create mode 100644 board/qualcomm/dragonboard845c/db845c.its
> > > > >  create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c
> > > > >  create mode 100644 configs/dragonboard845c_defconfig
> > > > >  create mode 100644 include/configs/dragonboard845c.h
> > > > >
> > > > [..]
> > > >
> > > > > diff --git a/doc/board/qualcomm/sdm845.rst 
> > > > > b/doc/board/qualcomm/sdm845.rst
> > > > > index b6642c9579..8ef4749287 100644
> > > > > --- a/doc/board/qualcomm/sdm845.rst
> > > > > +++ b/doc/board/qualcomm/sdm845.rst
> > > > > @@ -35,9 +35,25 @@ Pack android boot image
> > > > >  ^^^
> > > > >  We'll assemble android boot image with ``u-boot.bin`` instead of 
> > > > > linux kernel,
> > > > >  and FIT image instead of ``initramfs``. Android bootloader expect 
> > > > > gzipped kernel
> > > > > -with appended dtb, so let's mimic linux to satisfy stock bootloader:
> > > > > +with appended dtb, so let's mimic linux to satisfy stock bootloader.
> > > > >
> > > >
> > > > [..]
> > > >
> > > > > +The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, 
> > > > > based on
> > > > > +the Qualcomm SDM845 SoC.
> > > > > +
> > > > > +Steps:
> > > > > +
> > > > > +- Build u-boot::
> > > > > +
> > > > > +   $ export CROSS_COMPILE=
> > > > > +   $ make dragonboard845c_defconfig
> > > > > +   $ make
> > > > > +
> > > > > +- Create dummy dtb::
> > > > > +
> > > > > +   workdir=/tmp/prepare_payload
> > > > > +   mkdir -p "$workdir"
> > > > > +   mock_dtb="$workdir"/payload_mock.dtb
> > > > > +
> > > > > +   dtc -I dts -O dtb -o "$mock_dtb" << EOF
> > > > > +   /dts-v1/;
> > > > > +   / {
> > > > > +   #address-cells = <2>;
> > > > > +   #size-cells = <2>;
> > > > > +
> > > > > +   memory@8000 {
> > > > > +   device_type = "memory";
> > > > > +   /* We expect the bootloader to fill in the 
> > > > > size */
> > > > > +   reg = <0 0x8000 0 0>;
> > > > > +   };
> > > > > +
> > > > > +   chosen { };
> > > > > +   };
> > > > > +   EOF
> > > > > +
> > > > > +- gzip u-boot::
> > > > > +
> > > > > +   gzip u-boot.bin
> > > > > +
> > > > > +- Append dtb to gzipped u-boot::
> > > > > +
> > > > > +cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
> > > > > +
> > > > > +- A ``db845c.its`` file can be found in 
> > > > > ``board/qualcomm/dragonboard845c/``
> > > > > +  directory. It expects a folder as ``db845c_imgs/`` in the main 
> > > > > directory
> > > > > +  containing pre-built kernel, dts and ramdisk images. See 
> > > > > ``db845c.its``
> > > > > +  for full path to images::
> > > > > +
> > > > > +   mkimage -f db845c.its db845c.itb
> > > > > +
> > > > > 

Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2023-08-28 Thread Peter Robinson
On Mon, Aug 28, 2023 at 6:55 PM Simon Glass  wrote:
>
> Hi Sumit,
>
> On Thu, 24 Aug 2023 at 04:44, Sumit Garg  wrote:
> >
> > Hi Simon,
> >
> > On Thu, 24 Aug 2023 at 05:29, Simon Glass  wrote:
> > >
> > > Hi Sumit,
> > >
> > > On Tue, 12 Jul 2022 at 01:12, Sumit Garg  wrote:
> > > >
> > > > Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
> > > > platform. This board complies with 96Boards Open Platform 
> > > > Specifications.
> > > >
> > > > Features:
> > > > - Qualcomm Snapdragon SDA845 SoC
> > > > - 4GiB RAM
> > > > - 64GiB UFS drive
> > > >
> > > > U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
> > > > For detailed build and boot instructions, refer to
> > > > doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
> > > >
> > > > Signed-off-by: Sumit Garg 
> > > > Reviewed-by: Ramon Fried 
> > > > ---
> > > >  arch/arm/dts/dragonboard845c-uboot.dtsi   |  37 +++
> > > >  arch/arm/dts/dragonboard845c.dts  |  44 
> > > >  arch/arm/mach-snapdragon/Kconfig  |  14 +++
> > > >  board/qualcomm/dragonboard845c/Kconfig|  12 +++
> > > >  board/qualcomm/dragonboard845c/MAINTAINERS|   6 ++
> > > >  board/qualcomm/dragonboard845c/Makefile   |   9 ++
> > > >  board/qualcomm/dragonboard845c/db845c.its |  63 +++
> > > >  .../dragonboard845c/dragonboard845c.c |   9 ++
> > > >  configs/dragonboard845c_defconfig |  28 +
> > > >  doc/board/qualcomm/sdm845.rst | 100 +++---
> > > >  include/configs/dragonboard845c.h |  28 +
> > > >  11 files changed, 337 insertions(+), 13 deletions(-)
> > > >  create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi
> > > >  create mode 100644 arch/arm/dts/dragonboard845c.dts
> > > >  create mode 100644 board/qualcomm/dragonboard845c/Kconfig
> > > >  create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS
> > > >  create mode 100644 board/qualcomm/dragonboard845c/Makefile
> > > >  create mode 100644 board/qualcomm/dragonboard845c/db845c.its
> > > >  create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c
> > > >  create mode 100644 configs/dragonboard845c_defconfig
> > > >  create mode 100644 include/configs/dragonboard845c.h
> > > >
> > > [..]
> > >
> > > > diff --git a/doc/board/qualcomm/sdm845.rst 
> > > > b/doc/board/qualcomm/sdm845.rst
> > > > index b6642c9579..8ef4749287 100644
> > > > --- a/doc/board/qualcomm/sdm845.rst
> > > > +++ b/doc/board/qualcomm/sdm845.rst
> > > > @@ -35,9 +35,25 @@ Pack android boot image
> > > >  ^^^
> > > >  We'll assemble android boot image with ``u-boot.bin`` instead of linux 
> > > > kernel,
> > > >  and FIT image instead of ``initramfs``. Android bootloader expect 
> > > > gzipped kernel
> > > > -with appended dtb, so let's mimic linux to satisfy stock bootloader:
> > > > +with appended dtb, so let's mimic linux to satisfy stock bootloader.
> > > >
> > >
> > > [..]
> > >
> > > > +The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, 
> > > > based on
> > > > +the Qualcomm SDM845 SoC.
> > > > +
> > > > +Steps:
> > > > +
> > > > +- Build u-boot::
> > > > +
> > > > +   $ export CROSS_COMPILE=
> > > > +   $ make dragonboard845c_defconfig
> > > > +   $ make
> > > > +
> > > > +- Create dummy dtb::
> > > > +
> > > > +   workdir=/tmp/prepare_payload
> > > > +   mkdir -p "$workdir"
> > > > +   mock_dtb="$workdir"/payload_mock.dtb
> > > > +
> > > > +   dtc -I dts -O dtb -o "$mock_dtb" << EOF
> > > > +   /dts-v1/;
> > > > +   / {
> > > > +   #address-cells = <2>;
> > > > +   #size-cells = <2>;
> > > > +
> > > > +   memory@8000 {
> > > > +   device_type = "memory";
> > > > +   /* We expect the bootloader to fill in the size 
> > > > */
> > > > +   reg = <0 0x8000 0 0>;
> > > > +   };
> > > > +
> > > > +   chosen { };
> > > > +   };
> > > > +   EOF
> > > > +
> > > > +- gzip u-boot::
> > > > +
> > > > +   gzip u-boot.bin
> > > > +
> > > > +- Append dtb to gzipped u-boot::
> > > > +
> > > > +cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
> > > > +
> > > > +- A ``db845c.its`` file can be found in 
> > > > ``board/qualcomm/dragonboard845c/``
> > > > +  directory. It expects a folder as ``db845c_imgs/`` in the main 
> > > > directory
> > > > +  containing pre-built kernel, dts and ramdisk images. See 
> > > > ``db845c.its``
> > > > +  for full path to images::
> > > > +
> > > > +   mkimage -f db845c.its db845c.itb
> > > > +
> > > > +- Now we've got everything to build android boot image::
> > > > +
> > > > +   mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
> > > > +   --output boot.img --pagesize 4096 --base 0x8000
> > > > +
> > > > +- Flash boot.img using db845c fastboot method.
> > >
> > > What command should be used here? I 

Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2023-08-28 Thread Simon Glass
Hi Sumit,

On Thu, 24 Aug 2023 at 04:44, Sumit Garg  wrote:
>
> Hi Simon,
>
> On Thu, 24 Aug 2023 at 05:29, Simon Glass  wrote:
> >
> > Hi Sumit,
> >
> > On Tue, 12 Jul 2022 at 01:12, Sumit Garg  wrote:
> > >
> > > Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
> > > platform. This board complies with 96Boards Open Platform Specifications.
> > >
> > > Features:
> > > - Qualcomm Snapdragon SDA845 SoC
> > > - 4GiB RAM
> > > - 64GiB UFS drive
> > >
> > > U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
> > > For detailed build and boot instructions, refer to
> > > doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
> > >
> > > Signed-off-by: Sumit Garg 
> > > Reviewed-by: Ramon Fried 
> > > ---
> > >  arch/arm/dts/dragonboard845c-uboot.dtsi   |  37 +++
> > >  arch/arm/dts/dragonboard845c.dts  |  44 
> > >  arch/arm/mach-snapdragon/Kconfig  |  14 +++
> > >  board/qualcomm/dragonboard845c/Kconfig|  12 +++
> > >  board/qualcomm/dragonboard845c/MAINTAINERS|   6 ++
> > >  board/qualcomm/dragonboard845c/Makefile   |   9 ++
> > >  board/qualcomm/dragonboard845c/db845c.its |  63 +++
> > >  .../dragonboard845c/dragonboard845c.c |   9 ++
> > >  configs/dragonboard845c_defconfig |  28 +
> > >  doc/board/qualcomm/sdm845.rst | 100 +++---
> > >  include/configs/dragonboard845c.h |  28 +
> > >  11 files changed, 337 insertions(+), 13 deletions(-)
> > >  create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi
> > >  create mode 100644 arch/arm/dts/dragonboard845c.dts
> > >  create mode 100644 board/qualcomm/dragonboard845c/Kconfig
> > >  create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS
> > >  create mode 100644 board/qualcomm/dragonboard845c/Makefile
> > >  create mode 100644 board/qualcomm/dragonboard845c/db845c.its
> > >  create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c
> > >  create mode 100644 configs/dragonboard845c_defconfig
> > >  create mode 100644 include/configs/dragonboard845c.h
> > >
> > [..]
> >
> > > diff --git a/doc/board/qualcomm/sdm845.rst b/doc/board/qualcomm/sdm845.rst
> > > index b6642c9579..8ef4749287 100644
> > > --- a/doc/board/qualcomm/sdm845.rst
> > > +++ b/doc/board/qualcomm/sdm845.rst
> > > @@ -35,9 +35,25 @@ Pack android boot image
> > >  ^^^
> > >  We'll assemble android boot image with ``u-boot.bin`` instead of linux 
> > > kernel,
> > >  and FIT image instead of ``initramfs``. Android bootloader expect 
> > > gzipped kernel
> > > -with appended dtb, so let's mimic linux to satisfy stock bootloader:
> > > +with appended dtb, so let's mimic linux to satisfy stock bootloader.
> > >
> >
> > [..]
> >
> > > +The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, 
> > > based on
> > > +the Qualcomm SDM845 SoC.
> > > +
> > > +Steps:
> > > +
> > > +- Build u-boot::
> > > +
> > > +   $ export CROSS_COMPILE=
> > > +   $ make dragonboard845c_defconfig
> > > +   $ make
> > > +
> > > +- Create dummy dtb::
> > > +
> > > +   workdir=/tmp/prepare_payload
> > > +   mkdir -p "$workdir"
> > > +   mock_dtb="$workdir"/payload_mock.dtb
> > > +
> > > +   dtc -I dts -O dtb -o "$mock_dtb" << EOF
> > > +   /dts-v1/;
> > > +   / {
> > > +   #address-cells = <2>;
> > > +   #size-cells = <2>;
> > > +
> > > +   memory@8000 {
> > > +   device_type = "memory";
> > > +   /* We expect the bootloader to fill in the size */
> > > +   reg = <0 0x8000 0 0>;
> > > +   };
> > > +
> > > +   chosen { };
> > > +   };
> > > +   EOF
> > > +
> > > +- gzip u-boot::
> > > +
> > > +   gzip u-boot.bin
> > > +
> > > +- Append dtb to gzipped u-boot::
> > > +
> > > +cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
> > > +
> > > +- A ``db845c.its`` file can be found in 
> > > ``board/qualcomm/dragonboard845c/``
> > > +  directory. It expects a folder as ``db845c_imgs/`` in the main 
> > > directory
> > > +  containing pre-built kernel, dts and ramdisk images. See ``db845c.its``
> > > +  for full path to images::
> > > +
> > > +   mkimage -f db845c.its db845c.itb
> > > +
> > > +- Now we've got everything to build android boot image::
> > > +
> > > +   mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
> > > +   --output boot.img --pagesize 4096 --base 0x8000
> > > +
> > > +- Flash boot.img using db845c fastboot method.
> >
> > What command should be used here? I can run 'fastboot devices' but am
> > not sure what command to use to flash U-Boot.
> >
>
> At the time of writing this doc, I thought it was understood how to
> flash boot.img on db845c. But I will make that more explicit. Since
> u-boot has to be chain loaded by ABL, the command to flash boot.img
> (containing u-boot) is as follows:
>
> 

Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2023-08-24 Thread Sumit Garg
Hi Simon,

On Thu, 24 Aug 2023 at 05:29, Simon Glass  wrote:
>
> Hi Sumit,
>
> On Tue, 12 Jul 2022 at 01:12, Sumit Garg  wrote:
> >
> > Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
> > platform. This board complies with 96Boards Open Platform Specifications.
> >
> > Features:
> > - Qualcomm Snapdragon SDA845 SoC
> > - 4GiB RAM
> > - 64GiB UFS drive
> >
> > U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
> > For detailed build and boot instructions, refer to
> > doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
> >
> > Signed-off-by: Sumit Garg 
> > Reviewed-by: Ramon Fried 
> > ---
> >  arch/arm/dts/dragonboard845c-uboot.dtsi   |  37 +++
> >  arch/arm/dts/dragonboard845c.dts  |  44 
> >  arch/arm/mach-snapdragon/Kconfig  |  14 +++
> >  board/qualcomm/dragonboard845c/Kconfig|  12 +++
> >  board/qualcomm/dragonboard845c/MAINTAINERS|   6 ++
> >  board/qualcomm/dragonboard845c/Makefile   |   9 ++
> >  board/qualcomm/dragonboard845c/db845c.its |  63 +++
> >  .../dragonboard845c/dragonboard845c.c |   9 ++
> >  configs/dragonboard845c_defconfig |  28 +
> >  doc/board/qualcomm/sdm845.rst | 100 +++---
> >  include/configs/dragonboard845c.h |  28 +
> >  11 files changed, 337 insertions(+), 13 deletions(-)
> >  create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi
> >  create mode 100644 arch/arm/dts/dragonboard845c.dts
> >  create mode 100644 board/qualcomm/dragonboard845c/Kconfig
> >  create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS
> >  create mode 100644 board/qualcomm/dragonboard845c/Makefile
> >  create mode 100644 board/qualcomm/dragonboard845c/db845c.its
> >  create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c
> >  create mode 100644 configs/dragonboard845c_defconfig
> >  create mode 100644 include/configs/dragonboard845c.h
> >
> [..]
>
> > diff --git a/doc/board/qualcomm/sdm845.rst b/doc/board/qualcomm/sdm845.rst
> > index b6642c9579..8ef4749287 100644
> > --- a/doc/board/qualcomm/sdm845.rst
> > +++ b/doc/board/qualcomm/sdm845.rst
> > @@ -35,9 +35,25 @@ Pack android boot image
> >  ^^^
> >  We'll assemble android boot image with ``u-boot.bin`` instead of linux 
> > kernel,
> >  and FIT image instead of ``initramfs``. Android bootloader expect gzipped 
> > kernel
> > -with appended dtb, so let's mimic linux to satisfy stock bootloader:
> > +with appended dtb, so let's mimic linux to satisfy stock bootloader.
> >
>
> [..]
>
> > +The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based 
> > on
> > +the Qualcomm SDM845 SoC.
> > +
> > +Steps:
> > +
> > +- Build u-boot::
> > +
> > +   $ export CROSS_COMPILE=
> > +   $ make dragonboard845c_defconfig
> > +   $ make
> > +
> > +- Create dummy dtb::
> > +
> > +   workdir=/tmp/prepare_payload
> > +   mkdir -p "$workdir"
> > +   mock_dtb="$workdir"/payload_mock.dtb
> > +
> > +   dtc -I dts -O dtb -o "$mock_dtb" << EOF
> > +   /dts-v1/;
> > +   / {
> > +   #address-cells = <2>;
> > +   #size-cells = <2>;
> > +
> > +   memory@8000 {
> > +   device_type = "memory";
> > +   /* We expect the bootloader to fill in the size */
> > +   reg = <0 0x8000 0 0>;
> > +   };
> > +
> > +   chosen { };
> > +   };
> > +   EOF
> > +
> > +- gzip u-boot::
> > +
> > +   gzip u-boot.bin
> > +
> > +- Append dtb to gzipped u-boot::
> > +
> > +cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
> > +
> > +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/``
> > +  directory. It expects a folder as ``db845c_imgs/`` in the main directory
> > +  containing pre-built kernel, dts and ramdisk images. See ``db845c.its``
> > +  for full path to images::
> > +
> > +   mkimage -f db845c.its db845c.itb
> > +
> > +- Now we've got everything to build android boot image::
> > +
> > +   mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
> > +   --output boot.img --pagesize 4096 --base 0x8000
> > +
> > +- Flash boot.img using db845c fastboot method.
>
> What command should be used here? I can run 'fastboot devices' but am
> not sure what command to use to flash U-Boot.
>

At the time of writing this doc, I thought it was understood how to
flash boot.img on db845c. But I will make that more explicit. Since
u-boot has to be chain loaded by ABL, the command to flash boot.img
(containing u-boot) is as follows:

sudo fastboot flash boot boot.img

> Also, is it possible to flash U-Boot as a first-stage bootloader?
>

That's not possible currently due to Qcom proprietary bootloader being
used. But there were plans to replace atleast ABL with u-boot (See
slide 9 from this Linaro connect Qcom keynote [1]). I hope that will
materialize soon.


Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2023-08-23 Thread Simon Glass
Hi Sumit,

On Tue, 12 Jul 2022 at 01:12, Sumit Garg  wrote:
>
> Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
> platform. This board complies with 96Boards Open Platform Specifications.
>
> Features:
> - Qualcomm Snapdragon SDA845 SoC
> - 4GiB RAM
> - 64GiB UFS drive
>
> U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
> For detailed build and boot instructions, refer to
> doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
>
> Signed-off-by: Sumit Garg 
> Reviewed-by: Ramon Fried 
> ---
>  arch/arm/dts/dragonboard845c-uboot.dtsi   |  37 +++
>  arch/arm/dts/dragonboard845c.dts  |  44 
>  arch/arm/mach-snapdragon/Kconfig  |  14 +++
>  board/qualcomm/dragonboard845c/Kconfig|  12 +++
>  board/qualcomm/dragonboard845c/MAINTAINERS|   6 ++
>  board/qualcomm/dragonboard845c/Makefile   |   9 ++
>  board/qualcomm/dragonboard845c/db845c.its |  63 +++
>  .../dragonboard845c/dragonboard845c.c |   9 ++
>  configs/dragonboard845c_defconfig |  28 +
>  doc/board/qualcomm/sdm845.rst | 100 +++---
>  include/configs/dragonboard845c.h |  28 +
>  11 files changed, 337 insertions(+), 13 deletions(-)
>  create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi
>  create mode 100644 arch/arm/dts/dragonboard845c.dts
>  create mode 100644 board/qualcomm/dragonboard845c/Kconfig
>  create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS
>  create mode 100644 board/qualcomm/dragonboard845c/Makefile
>  create mode 100644 board/qualcomm/dragonboard845c/db845c.its
>  create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c
>  create mode 100644 configs/dragonboard845c_defconfig
>  create mode 100644 include/configs/dragonboard845c.h
>
[..]

> diff --git a/doc/board/qualcomm/sdm845.rst b/doc/board/qualcomm/sdm845.rst
> index b6642c9579..8ef4749287 100644
> --- a/doc/board/qualcomm/sdm845.rst
> +++ b/doc/board/qualcomm/sdm845.rst
> @@ -35,9 +35,25 @@ Pack android boot image
>  ^^^
>  We'll assemble android boot image with ``u-boot.bin`` instead of linux 
> kernel,
>  and FIT image instead of ``initramfs``. Android bootloader expect gzipped 
> kernel
> -with appended dtb, so let's mimic linux to satisfy stock bootloader:
> +with appended dtb, so let's mimic linux to satisfy stock bootloader.
>

[..]

> +The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on
> +the Qualcomm SDM845 SoC.
> +
> +Steps:
> +
> +- Build u-boot::
> +
> +   $ export CROSS_COMPILE=
> +   $ make dragonboard845c_defconfig
> +   $ make
> +
> +- Create dummy dtb::
> +
> +   workdir=/tmp/prepare_payload
> +   mkdir -p "$workdir"
> +   mock_dtb="$workdir"/payload_mock.dtb
> +
> +   dtc -I dts -O dtb -o "$mock_dtb" << EOF
> +   /dts-v1/;
> +   / {
> +   #address-cells = <2>;
> +   #size-cells = <2>;
> +
> +   memory@8000 {
> +   device_type = "memory";
> +   /* We expect the bootloader to fill in the size */
> +   reg = <0 0x8000 0 0>;
> +   };
> +
> +   chosen { };
> +   };
> +   EOF
> +
> +- gzip u-boot::
> +
> +   gzip u-boot.bin
> +
> +- Append dtb to gzipped u-boot::
> +
> +cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
> +
> +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/``
> +  directory. It expects a folder as ``db845c_imgs/`` in the main directory
> +  containing pre-built kernel, dts and ramdisk images. See ``db845c.its``
> +  for full path to images::
> +
> +   mkimage -f db845c.its db845c.itb
> +
> +- Now we've got everything to build android boot image::
> +
> +   mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
> +   --output boot.img --pagesize 4096 --base 0x8000
> +
> +- Flash boot.img using db845c fastboot method.

What command should be used here? I can run 'fastboot devices' but am
not sure what command to use to flash U-Boot.

Also, is it possible to flash U-Boot as a first-stage bootloader?

> +
> +More information can be found on the `DragonBoard 845c page`_.
>
>  .. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9
> +.. _DragonBoard 845c page: https://www.96boards.org/product/rb3-platform/
> diff --git a/include/configs/dragonboard845c.h 
> b/include/configs/dragonboard845c.h
> new file mode 100644
> index 00..108dde199b
> --- /dev/null
> +++ b/include/configs/dragonboard845c.h
> @@ -0,0 +1,28 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Configuration file for Dragonboard 845c, based on Qualcomm SDA845 chip
> + *
> + * (C) Copyright 2022 Sumit Garg 
> + */
> +
> +#ifndef __CONFIGS_SDM845_H
> +#define __CONFIGS_SDM845_H
> +
> +#include 
> +#include 
> +
> +#define CONFIG_SYS_BAUDRATE_TABLE  { 115200, 230400, 460800, 921600 }
> +
> 

Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2022-07-25 Thread Tom Rini
On Tue, Jul 12, 2022 at 12:42:08PM +0530, Sumit Garg wrote:

> Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
> platform. This board complies with 96Boards Open Platform Specifications.
> 
> Features:
> - Qualcomm Snapdragon SDA845 SoC
> - 4GiB RAM
> - 64GiB UFS drive
> 
> U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
> For detailed build and boot instructions, refer to
> doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
> 
> Signed-off-by: Sumit Garg 
> Reviewed-by: Ramon Fried 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c

2022-07-12 Thread Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
platform. This board complies with 96Boards Open Platform Specifications.

Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS drive

U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.

Signed-off-by: Sumit Garg 
Reviewed-by: Ramon Fried 
---
 arch/arm/dts/dragonboard845c-uboot.dtsi   |  37 +++
 arch/arm/dts/dragonboard845c.dts  |  44 
 arch/arm/mach-snapdragon/Kconfig  |  14 +++
 board/qualcomm/dragonboard845c/Kconfig|  12 +++
 board/qualcomm/dragonboard845c/MAINTAINERS|   6 ++
 board/qualcomm/dragonboard845c/Makefile   |   9 ++
 board/qualcomm/dragonboard845c/db845c.its |  63 +++
 .../dragonboard845c/dragonboard845c.c |   9 ++
 configs/dragonboard845c_defconfig |  28 +
 doc/board/qualcomm/sdm845.rst | 100 +++---
 include/configs/dragonboard845c.h |  28 +
 11 files changed, 337 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi
 create mode 100644 arch/arm/dts/dragonboard845c.dts
 create mode 100644 board/qualcomm/dragonboard845c/Kconfig
 create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS
 create mode 100644 board/qualcomm/dragonboard845c/Makefile
 create mode 100644 board/qualcomm/dragonboard845c/db845c.its
 create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c
 create mode 100644 configs/dragonboard845c_defconfig
 create mode 100644 include/configs/dragonboard845c.h

diff --git a/arch/arm/dts/dragonboard845c-uboot.dtsi 
b/arch/arm/dts/dragonboard845c-uboot.dtsi
new file mode 100644
index 00..8b5a7ee573
--- /dev/null
+++ b/arch/arm/dts/dragonboard845c-uboot.dtsi
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot addition to handle Qualcomm Robotics RB3 Development Platform
+ * (dragonboard845c) pins
+ *
+ * (C) Copyright 2022 Sumit Garg 
+ */
+
+/
+{
+   soc {
+   u-boot,dm-pre-reloc;
+
+   serial@a84000 {
+   u-boot,dm-pre-reloc;
+   };
+
+   clock-controller@10 {
+   u-boot,dm-pre-reloc;
+   };
+
+   pinctrl_north@390 {
+   u-boot,dm-pre-reloc;
+   };
+   };
+};
+
+_pon {
+   key_vol_down {
+   gpios = <_pon 1 0>;
+   label = "key_vol_down";
+   };
+   key_power {
+   gpios = <_pon 0 0>;
+   label = "key_power";
+   };
+};
diff --git a/arch/arm/dts/dragonboard845c.dts b/arch/arm/dts/dragonboard845c.dts
new file mode 100644
index 00..1722dce33f
--- /dev/null
+++ b/arch/arm/dts/dragonboard845c.dts
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Qualcomm Robotics RB3 Development (dragonboard845c) board device
+ * tree source
+ *
+ * (C) Copyright 2022 Sumit Garg 
+ */
+
+/dts-v1/;
+
+#include "sdm845.dtsi"
+
+/ {
+   model = "Thundercomm Dragonboard 845c";
+   compatible = "thundercomm,db845c", "qcom,sdm845";
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   aliases {
+   serial0 = _uart;
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0 0x8000 0 0xfdfa>;
+   };
+
+   psci {
+   compatible = "arm,psci-1.0";
+   method = "smc";
+   };
+
+   soc: soc {
+   serial@a84000 {
+   status = "okay";
+   };
+   };
+};
+
+#include "dragonboard845c-uboot.dtsi"
diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
index 12cf02a56a..cb53dc8901 100644
--- a/arch/arm/mach-snapdragon/Kconfig
+++ b/arch/arm/mach-snapdragon/Kconfig
@@ -44,6 +44,19 @@ config TARGET_DRAGONBOARD820C
  - 3GiB RAM
  - 32GiB UFS drive
 
+config TARGET_DRAGONBOARD845C
+   bool "96Boards Dragonboard 845C"
+   help
+ Support for 96Boards Dragonboard 845C aka Robotics RB3 Development
+ Platform. This board complies with 96Boards Open Platform
+ Specifications. Features:
+ - Qualcomm Snapdragon SDA845 SoC
+ - 4GiB RAM
+ - 64GiB UFS drive
+   select MISC_INIT_R
+   select SDM845
+   select DM_ETH if NET
+
 config TARGET_STARQLTECHN
bool "Samsung S9 SM-G9600(starqltechn)"
help
@@ -60,6 +73,7 @@ endchoice
 
 source "board/qualcomm/dragonboard410c/Kconfig"
 source "board/qualcomm/dragonboard820c/Kconfig"
+source "board/qualcomm/dragonboard845c/Kconfig"
 source "board/samsung/starqltechn/Kconfig"
 
 endif
diff --git a/board/qualcomm/dragonboard845c/Kconfig 
b/board/qualcomm/dragonboard845c/Kconfig
new file