Re: [PATCH 6/6 v3] board: samsung: add Samsung Galaxy S9/S9+(SM-G96x0) board

2021-10-05 Thread Tom Rini
On Thu, Sep 23, 2021 at 09:57:32PM +0300, dsankou...@gmail.com wrote:

> From: Dzmitry Sankouski 
> 
> Samsung S9 SM-G9600 - Snapdragon SDM845 version of the phone,
> for China \ Hong Kong markets.
> Has unlockable bootloader, unlike SM-G960U (American market version),
> which allows running u-boot as a chain-loaded bootloader.
> 
> Signed-off-by: Dzmitry Sankouski 
> Cc: Ramon Fried 
> Cc: Tom Rini 
> ---
> Changes for v2:
> - Create documentation file for SDM845 boards
> - Add starqltechn board documentation
> Changes for v3:
> - fix comment in starqltechn.c

A few things.  Aside from needing to migrate a few symbols to Kconfig,
to build on current master, we need to:

> diff --git a/include/configs/starqltechn.h b/include/configs/starqltechn.h
> new file mode 100644
> index 00..c9736a443b
> --- /dev/null
> +++ b/include/configs/starqltechn.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/*
> + * Board configuration file for Samsung S9(SM-G9600)(starqltechn)
> + *
> + * (C) Copyright 2017 Jorge Ramirez-Ortiz 
> + */
> +
> +#ifndef __CONFIGS_STARQLTECHN_H
> +#define __CONFIGS_STARQLTECHN_H
> +
> +#include 
> +
> +#define CONFIG_LNX_KRNL_IMG_TEXT_OFFSET_BASECONFIG_SYS_LOAD_ADDR
> +#define CONFIG_LINUX_KERNEL_IMAGE_HEADER

These two symbols need to be handled via Kconfig (xenguest_arm64 gets
this wrong as well, I see) as done for example on Tegra.  At that point,
we can delete this file entirely and just use configs/sdm845.h.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 6/6 v3] board: samsung: add Samsung Galaxy S9/S9+(SM-G96x0) board

2021-09-24 Thread Stephan Gerhold
Hi,

On Fri, Sep 24, 2021 at 05:35:57PM +0300, Dzmitry Sankouski wrote:
> I haven't tried to install u-boot on the phone with Android boot image
> yet(though another guy in the community project I contribute, reported it
> works).
> I can only test u-boot with kexec, it's the only way to get debug uart for
> me, without disassembling the phone.
> 

Hmm, does Samsung not have UART via the USB connector anymore on newer
devices? This is quite sad, on the Samsung devices I have used
it was always quite comfortable. :)

> Also I have to track down the issues with booting linux.
> 
> So, once I'll got linux booted by u-boot, I will be able to pack and
> install it in Android boot partition, and write more detailed instructions.
> 

Ah okay, maybe just submit a follow-up patch later then once you have
proper installation instructions. :)

Thanks!
Stephan


Re: [PATCH 6/6 v3] board: samsung: add Samsung Galaxy S9/S9+(SM-G96x0) board

2021-09-24 Thread Dzmitry Sankouski
Hi!

I haven't tried to install u-boot on the phone with Android boot image
yet(though another guy in the community project I contribute, reported it
works).
I can only test u-boot with kexec, it's the only way to get debug uart for
me, without disassembling the phone.

Also I have to track down the issues with booting linux.

So, once I'll got linux booted by u-boot, I will be able to pack and
install it in Android boot partition, and write more detailed instructions.

пт, 24 сент. 2021 г. в 14:02, Stephan Gerhold :

> Hi,
>
> On Thu, Sep 23, 2021 at 09:57:32PM +0300, dsankou...@gmail.com wrote:
> > From: Dzmitry Sankouski 
> >
> > Samsung S9 SM-G9600 - Snapdragon SDM845 version of the phone,
> > for China \ Hong Kong markets.
> > Has unlockable bootloader, unlike SM-G960U (American market version),
> > which allows running u-boot as a chain-loaded bootloader.
> >
> > Signed-off-by: Dzmitry Sankouski 
> > Cc: Ramon Fried 
> > Cc: Tom Rini 
> > ---
> > Changes for v2:
> > - Create documentation file for SDM845 boards
> > - Add starqltechn board documentation
> > Changes for v3:
> > - fix comment in starqltechn.c
> >
> >  arch/arm/dts/Makefile   |  1 +
> >  arch/arm/dts/starqltechn-uboot.dtsi | 39 ++
> >  arch/arm/dts/starqltechn.dts| 53 +
> >  arch/arm/mach-snapdragon/Kconfig| 13 ++
> >  board/samsung/starqltechn/Kconfig   | 14 +++
> >  board/samsung/starqltechn/MAINTAINERS   |  6 +++
> >  board/samsung/starqltechn/Makefile  |  9 +
> >  board/samsung/starqltechn/starqltechn.c | 10 +
> >  configs/starqltechn_defconfig   | 33 +++
> >  doc/board/qualcomm/index.rst|  1 +
> >  doc/board/qualcomm/sdm845.rst   | 38 ++
> >  include/configs/starqltechn.h   | 16 
> >  12 files changed, 233 insertions(+)
> >  create mode 100644 arch/arm/dts/starqltechn-uboot.dtsi
> >  create mode 100644 arch/arm/dts/starqltechn.dts
> >  create mode 100644 board/samsung/starqltechn/Kconfig
> >  create mode 100644 board/samsung/starqltechn/MAINTAINERS
> >  create mode 100644 board/samsung/starqltechn/Makefile
> >  create mode 100644 board/samsung/starqltechn/starqltechn.c
> >  create mode 100644 configs/starqltechn_defconfig
> >  create mode 100644 doc/board/qualcomm/sdm845.rst
> >  create mode 100644 include/configs/starqltechn.h
> >
> > [...]
> > diff --git a/doc/board/qualcomm/sdm845.rst
> b/doc/board/qualcomm/sdm845.rst
> > new file mode 100644
> > index 00..cd46cbe9cf
> > --- /dev/null
> > +++ b/doc/board/qualcomm/sdm845.rst
> > @@ -0,0 +1,38 @@
> > +.. SPDX-License-Identifier: GPL-2.0+
> > +.. sectionauthor:: Dzmitry Sankouski 
> > +
> > +Snapdragon 845
> > +
> > +
> > +About this
> > +--
> > +This document describes the information about Qualcomm Snapdragon 845
> > +supported boards and it's usage steps.
> > +
> > +SDM845 - hi-end qualcomm chip, introduced in late 2017.
> > +Mostly used in flagship phones and tablets of 2018.
> > +
> > +U-Boot can be used as a replacement for Qualcomm's original ABL (UEFI)
> bootloader.
> > +It is loaded as an Android boot image through ABL
> > +
> > +Installation
> > +
> > +First, setup ``CROSS_COMPILE`` for aarch64. Then, build U-Boot for your
> board::
> > +
> > + $ export CROSS_COMPILE=
> > + $ make _defconfig
> > + $ make
> > +
> > +This will build ``u-boot.bin`` in the configured output directory.
> > +
> > +Boards
> > +
> > +starqlte
> > +
> > +
> > +The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
> > +based on the Qualcomm SDM845 SoC.
> > +
> > +More information can be found on the `Samsung S9 page`_.
> > +
> > +.. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9
>
> Can you add a short explanation here how you would install the
> u-boot.bin on the Samsung S9? You say that it is loaded through an
> Android boot image, but how exactly is it built?
>
> For example, do you use an empty ramdisk, does the bootloader expect
> some dt.img etc? Something similar to the DB820c README:
>
> https://source.denx.de/u-boot/u-boot/-/blob/master/board/qualcomm/dragonboard820c/readme.txt#L32-61
>
> This would be helpful if someone wants to install U-Boot on that phone
> I think :)
>
> Thanks!
> Stephan
>


Re: [PATCH 6/6 v3] board: samsung: add Samsung Galaxy S9/S9+(SM-G96x0) board

2021-09-24 Thread Stephan Gerhold
Hi,

On Thu, Sep 23, 2021 at 09:57:32PM +0300, dsankou...@gmail.com wrote:
> From: Dzmitry Sankouski 
> 
> Samsung S9 SM-G9600 - Snapdragon SDM845 version of the phone,
> for China \ Hong Kong markets.
> Has unlockable bootloader, unlike SM-G960U (American market version),
> which allows running u-boot as a chain-loaded bootloader.
> 
> Signed-off-by: Dzmitry Sankouski 
> Cc: Ramon Fried 
> Cc: Tom Rini 
> ---
> Changes for v2:
> - Create documentation file for SDM845 boards
> - Add starqltechn board documentation
> Changes for v3:
> - fix comment in starqltechn.c
> 
>  arch/arm/dts/Makefile   |  1 +
>  arch/arm/dts/starqltechn-uboot.dtsi | 39 ++
>  arch/arm/dts/starqltechn.dts| 53 +
>  arch/arm/mach-snapdragon/Kconfig| 13 ++
>  board/samsung/starqltechn/Kconfig   | 14 +++
>  board/samsung/starqltechn/MAINTAINERS   |  6 +++
>  board/samsung/starqltechn/Makefile  |  9 +
>  board/samsung/starqltechn/starqltechn.c | 10 +
>  configs/starqltechn_defconfig   | 33 +++
>  doc/board/qualcomm/index.rst|  1 +
>  doc/board/qualcomm/sdm845.rst   | 38 ++
>  include/configs/starqltechn.h   | 16 
>  12 files changed, 233 insertions(+)
>  create mode 100644 arch/arm/dts/starqltechn-uboot.dtsi
>  create mode 100644 arch/arm/dts/starqltechn.dts
>  create mode 100644 board/samsung/starqltechn/Kconfig
>  create mode 100644 board/samsung/starqltechn/MAINTAINERS
>  create mode 100644 board/samsung/starqltechn/Makefile
>  create mode 100644 board/samsung/starqltechn/starqltechn.c
>  create mode 100644 configs/starqltechn_defconfig
>  create mode 100644 doc/board/qualcomm/sdm845.rst
>  create mode 100644 include/configs/starqltechn.h
> 
> [...]
> diff --git a/doc/board/qualcomm/sdm845.rst b/doc/board/qualcomm/sdm845.rst
> new file mode 100644
> index 00..cd46cbe9cf
> --- /dev/null
> +++ b/doc/board/qualcomm/sdm845.rst
> @@ -0,0 +1,38 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +.. sectionauthor:: Dzmitry Sankouski 
> +
> +Snapdragon 845
> +
> +
> +About this
> +--
> +This document describes the information about Qualcomm Snapdragon 845
> +supported boards and it's usage steps.
> +
> +SDM845 - hi-end qualcomm chip, introduced in late 2017.
> +Mostly used in flagship phones and tablets of 2018.
> +
> +U-Boot can be used as a replacement for Qualcomm's original ABL (UEFI) 
> bootloader.
> +It is loaded as an Android boot image through ABL
> +
> +Installation
> +
> +First, setup ``CROSS_COMPILE`` for aarch64. Then, build U-Boot for your 
> board::
> +
> + $ export CROSS_COMPILE=
> + $ make _defconfig
> + $ make
> +
> +This will build ``u-boot.bin`` in the configured output directory.
> +
> +Boards
> +
> +starqlte
> +
> +
> +The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
> +based on the Qualcomm SDM845 SoC.
> +
> +More information can be found on the `Samsung S9 page`_.
> +
> +.. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9

Can you add a short explanation here how you would install the
u-boot.bin on the Samsung S9? You say that it is loaded through an
Android boot image, but how exactly is it built?

For example, do you use an empty ramdisk, does the bootloader expect
some dt.img etc? Something similar to the DB820c README:
https://source.denx.de/u-boot/u-boot/-/blob/master/board/qualcomm/dragonboard820c/readme.txt#L32-61

This would be helpful if someone wants to install U-Boot on that phone
I think :)

Thanks!
Stephan