Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2024-07-05 Thread Christopher Obbard
Hi Jonas,

On Tue, 2023-10-17 at 10:02 +0100, Christopher Obbard wrote:
> Hi Jonas,
> 
> On Sat, 2023-10-14 at 21:22 +0200, Jonas Karlman wrote:
> > On 2023-10-14 20:58, Jonas Karlman wrote:
> > > Hi Christopher,
> > > 
> > > On 2023-10-12 13:46, Christopher Obbard wrote:
> > > > Hi Jonas,
> > > > 
> > > > On Thu, 2023-10-12 at 10:51 +0100, Christopher Obbard wrote:
> > > > > Hi Jonas,
> > > > > 
> > > > > Sorry for the late response, I've been meaning to test this for a
> > > > > while but not got around to it.
> > > > > 
> > > > > On Thu, 2023-08-17 at 23:56 +, Jonas Karlman wrote:
> > > > > > Hi Christopher,
> > > > > > 
> > > > > > On 2023-08-08 16:25, Christopher Obbard wrote:
> > > > > > > Hi Jonas,
> > > > > > > 
> > > > > > > On Sun, 2023-07-23 at 15:04 +, Jonas Karlman wrote:
> > > > > > > > On 2023-07-23 16:55, Jonas Karlman wrote:
> > > > > > > > > The Pine64 Quartz64 Model A is a single-board computer based
> > > > > > > > > on the
> > > > > > > > > Rockchip RK3566 SoC. The board features USB3, SATA, PCIe,
> > > > > > > > > HDMI, USB2.0,
> > > > > > > > > CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as
> > > > > > > > > well as a
> > > > > > > > > 20 pin GPIO header.
> > > > > > > > > 
> > > > > > > > > Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
> > > > > > > > > - SD-card boot
> > > > > > > > > - eMMC boot
> > > > > > > > > - PCIe/NVMe/AHCI
> > > > > > > > > - USB host
> > > > > > > > > 
> > > > > > > > > Device tree is imported from linux v6.4.
> > > > > > > > > 
> > > > > > > > > Co-developed-by: Nicolas Frattaroli
> > > > > > > > > 
> > > > > > > > > Signed-off-by: Nicolas Frattaroli
> > > > > > > > > 
> > > > > > > > > Signed-off-by: Jonas Karlman 
> > > > > > > > > ---
> > > > > > > > 
> > > > > > > > [...]
> > > > > > > > 
> > > > > > > > Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
> > > > > > > > BL31=rk3568_bl31_v1.43.elf:
> > > > > > > > 
> > > > > > > > [...]
> > > > > > > > 
> > > > > > > > U-Boot 2023.07 (Jul 23 2023 - 12:42:18 +)
> > > > > > > > 
> > > > > > > > Model: Pine64 RK3566 Quartz64-A Board
> > > > > > > > DRAM:  8 GiB (effective 7.7 GiB)
> > > > > > > > PMIC:  RK8170 (on=0x10, off=0x00)
> > > > > > > > Core:  321 devices, 27 uclasses, devicetree: separate
> > > > > > > > MMC:   rockchip_sdhci_probe clk set rate fail!
> > > > > > > > mmc@fe2b: 1, mmc@fe2c: 2, mmc@fe31: 0
> > > > > > > > Loading Environment from nowhere... OK
> > > > > > > > In:    serial@fe66
> > > > > > > > Out:   serial@fe66
> > > > > > > > Err:   serial@fe66
> > > > > > > > Model: Pine64 RK3566 Quartz64-A Board
> > > > > > > > Net:   No ethernet found.
> > > > > > > > 
> > > > > > > > Hit any key to stop autoboot:  0
> > > > > > > > =>
> > > > > > > 
> > > > > > > 
> > > > > > > I just tried booting U-Boot v2023.10-rc2 with
> > > > > > > ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
> > > > > > > BL31=rk3568_bl31_v1.43.elf, on my Quartz64-A but it fails during
> > > > > > > loading of some parts. I removed the output of the RK TPL from
> > > > > > > my logs as there were no errors.
> > > > > > 
> > > > > > Try with latest rk3566_ddr_1056MHz_v1.18.bin and see if that makes
> > > > > > any
> > > > > > difference.
> > > > > 
> > > > > No difference.
> > > > > 
> > > > > I've also checked, there is no other maskrom bootable media such as
> > > > > SPI flash connected to the board.
> > > > > 
> > > > > > 
> > > > > > > This is when booting from eMMC.
> > > > > > 
> > > > > > Does it boot with SD-card or other eMMC modules?
> > > > > 
> > > > > Booting from SD card (without eMMC connected), everything works
> > > > > fine.
> > > > > 
> > > > > > 
> > > > > 
> > > > > > > I also tried building your branch from
> > > > > > > https://github.com/Kwiboo/u-boot-rockchip/tree/rk3568-2023.10 
> > > > > > 
> > > > > > Please try with a GitHub actions built u-boot-rockchip.bin based
> > > > > > on my
> > > > > > rk3568-2023.07.02 branch at
> > > > > > https://github.com/Kwiboo/u-boot-build/actions/runs/561235
> > > > > 
> > > > > With that exact artifact, flashed with:
> > > > > 
> > > > > > rkdeveloptool db rk356x_spl_loader_v1.18.113.bin
> > > > > > rkdeveloptool ef
> > > > > > rkdeveloptool wl 64 u-boot-rockchip.bin
> > > > > > rkdeveloptool rd
> > > > > 
> > > > > it fails to boot with with:
> > > > > 
> > > > > > DDR V1.18 f366f69a7d typ 23/07/17-15:48:58
> > > > > > ln
> > > > > > LP4/4x derate en, other dram:1x trefi
> > > > > > SRX
> > > > > > ddrconfig:7
> > > > > > LPDDR4X, 324MHz
> > > > > > BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB
> > > > > > 
> > > > > > change to: 324MHz
> > > > > > clk skew:0x60
> > > > > > 
> > > > > > change to: 528MHz
> > > > > > clk skew:0x58
> > > > > > 
> > > > > > change to: 780MHz
> > > > > > clk skew:0x58
> > > > > > 
> > > > > > change to: 1056MHz(final freq)
> > > > > > clk skew:0x32
> > > > > > out
> > > > > > 
> > > > > > U-Boot SPL 2023.07.02-g09919887 (Aug 06 2023 - 16:59:

Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-10-17 Thread Christopher Obbard
Hi Jonas,

On Sat, 2023-10-14 at 21:22 +0200, Jonas Karlman wrote:
> On 2023-10-14 20:58, Jonas Karlman wrote:
> > Hi Christopher,
> > 
> > On 2023-10-12 13:46, Christopher Obbard wrote:
> > > Hi Jonas,
> > > 
> > > On Thu, 2023-10-12 at 10:51 +0100, Christopher Obbard wrote:
> > > > Hi Jonas,
> > > > 
> > > > Sorry for the late response, I've been meaning to test this for a while 
> > > > but not got around to it.
> > > > 
> > > > On Thu, 2023-08-17 at 23:56 +, Jonas Karlman wrote:
> > > > > Hi Christopher,
> > > > > 
> > > > > On 2023-08-08 16:25, Christopher Obbard wrote:
> > > > > > Hi Jonas,
> > > > > > 
> > > > > > On Sun, 2023-07-23 at 15:04 +, Jonas Karlman wrote:
> > > > > > > On 2023-07-23 16:55, Jonas Karlman wrote:
> > > > > > > > The Pine64 Quartz64 Model A is a single-board computer based on 
> > > > > > > > the
> > > > > > > > Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, 
> > > > > > > > USB2.0,
> > > > > > > > CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well 
> > > > > > > > as a
> > > > > > > > 20 pin GPIO header.
> > > > > > > > 
> > > > > > > > Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
> > > > > > > > - SD-card boot
> > > > > > > > - eMMC boot
> > > > > > > > - PCIe/NVMe/AHCI
> > > > > > > > - USB host
> > > > > > > > 
> > > > > > > > Device tree is imported from linux v6.4.
> > > > > > > > 
> > > > > > > > Co-developed-by: Nicolas Frattaroli 
> > > > > > > > 
> > > > > > > > Signed-off-by: Nicolas Frattaroli 
> > > > > > > > Signed-off-by: Jonas Karlman 
> > > > > > > > ---
> > > > > > > 
> > > > > > > [...]
> > > > > > > 
> > > > > > > Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
> > > > > > > BL31=rk3568_bl31_v1.43.elf:
> > > > > > > 
> > > > > > > [...]
> > > > > > > 
> > > > > > > U-Boot 2023.07 (Jul 23 2023 - 12:42:18 +)
> > > > > > > 
> > > > > > > Model: Pine64 RK3566 Quartz64-A Board
> > > > > > > DRAM:  8 GiB (effective 7.7 GiB)
> > > > > > > PMIC:  RK8170 (on=0x10, off=0x00)
> > > > > > > Core:  321 devices, 27 uclasses, devicetree: separate
> > > > > > > MMC:   rockchip_sdhci_probe clk set rate fail!
> > > > > > > mmc@fe2b: 1, mmc@fe2c: 2, mmc@fe31: 0
> > > > > > > Loading Environment from nowhere... OK
> > > > > > > In:    serial@fe66
> > > > > > > Out:   serial@fe66
> > > > > > > Err:   serial@fe66
> > > > > > > Model: Pine64 RK3566 Quartz64-A Board
> > > > > > > Net:   No ethernet found.
> > > > > > > 
> > > > > > > Hit any key to stop autoboot:  0
> > > > > > > =>
> > > > > > 
> > > > > > 
> > > > > > I just tried booting U-Boot v2023.10-rc2 with 
> > > > > > ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and 
> > > > > > BL31=rk3568_bl31_v1.43.elf, on my Quartz64-A but it fails during
> > > > > > loading of some parts. I removed the output of the RK TPL from my 
> > > > > > logs as there were no errors.
> > > > > 
> > > > > Try with latest rk3566_ddr_1056MHz_v1.18.bin and see if that makes any
> > > > > difference.
> > > > 
> > > > No difference.
> > > > 
> > > > I've also checked, there is no other maskrom bootable media such as SPI 
> > > > flash connected to the board.
> > > > 
> > > > > 
> > > > > > This is when booting from eMMC.
> > > > > 
> > > > > Does it boot with SD-card or other eMMC modules?
> > > > 
> > > > Booting from SD card (without eMMC connected), everything works fine.
> > > > 
> > > > > 
> > > > 
> > > > > > I also tried building your branch from 
> > > > > > https://github.com/Kwiboo/u-boot-rockchip/tree/rk3568-2023.10 
> > > > > 
> > > > > Please try with a GitHub actions built u-boot-rockchip.bin based on my
> > > > > rk3568-2023.07.02 branch at
> > > > > https://github.com/Kwiboo/u-boot-build/actions/runs/561235
> > > > 
> > > > With that exact artifact, flashed with:
> > > > 
> > > > > rkdeveloptool db rk356x_spl_loader_v1.18.113.bin
> > > > > rkdeveloptool ef
> > > > > rkdeveloptool wl 64 u-boot-rockchip.bin
> > > > > rkdeveloptool rd
> > > > 
> > > > it fails to boot with with:
> > > > 
> > > > > DDR V1.18 f366f69a7d typ 23/07/17-15:48:58
> > > > > ln
> > > > > LP4/4x derate en, other dram:1x trefi
> > > > > SRX
> > > > > ddrconfig:7
> > > > > LPDDR4X, 324MHz
> > > > > BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB
> > > > > 
> > > > > change to: 324MHz
> > > > > clk skew:0x60
> > > > > 
> > > > > change to: 528MHz
> > > > > clk skew:0x58
> > > > > 
> > > > > change to: 780MHz
> > > > > clk skew:0x58
> > > > > 
> > > > > change to: 1056MHz(final freq)
> > > > > clk skew:0x32
> > > > > out
> > > > > 
> > > > > U-Boot SPL 2023.07.02-g09919887 (Aug 06 2023 - 16:59:31 +)
> > > > > Trying to boot from MMC1
> > > > > spl: mmc init failed with error: -70
> > > > > Trying to boot from MMC2
> > > > > Card did not respond to voltage select! : -110
> > > > > spl: mmc init failed with error: -95
> > > > > Trying to boot from MMC1
> > > > > mmc fail to send stop cmd
> > > > > mmc_load_image_raw_sector: mmc block read error
> > > > > SPL: fai

Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-10-14 Thread Jonas Karlman
Hi Christopher,

On 2023-10-12 13:46, Christopher Obbard wrote:
> Hi Jonas,
> 
> On Thu, 2023-10-12 at 10:51 +0100, Christopher Obbard wrote:
>> Hi Jonas,
>>
>> Sorry for the late response, I've been meaning to test this for a while but 
>> not got around to it.
>>
>> On Thu, 2023-08-17 at 23:56 +, Jonas Karlman wrote:
>>> Hi Christopher,
>>>
>>> On 2023-08-08 16:25, Christopher Obbard wrote:
 Hi Jonas,

 On Sun, 2023-07-23 at 15:04 +, Jonas Karlman wrote:
> On 2023-07-23 16:55, Jonas Karlman wrote:
>> The Pine64 Quartz64 Model A is a single-board computer based on the
>> Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, USB2.0,
>> CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
>> 20 pin GPIO header.
>>
>> Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
>> - SD-card boot
>> - eMMC boot
>> - PCIe/NVMe/AHCI
>> - USB host
>>
>> Device tree is imported from linux v6.4.
>>
>> Co-developed-by: Nicolas Frattaroli 
>> Signed-off-by: Nicolas Frattaroli 
>> Signed-off-by: Jonas Karlman 
>> ---
>
> [...]
>
> Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
> BL31=rk3568_bl31_v1.43.elf:
>
> [...]
>
> U-Boot 2023.07 (Jul 23 2023 - 12:42:18 +)
>
> Model: Pine64 RK3566 Quartz64-A Board
> DRAM:  8 GiB (effective 7.7 GiB)
> PMIC:  RK8170 (on=0x10, off=0x00)
> Core:  321 devices, 27 uclasses, devicetree: separate
> MMC:   rockchip_sdhci_probe clk set rate fail!
> mmc@fe2b: 1, mmc@fe2c: 2, mmc@fe31: 0
> Loading Environment from nowhere... OK
> In:    serial@fe66
> Out:   serial@fe66
> Err:   serial@fe66
> Model: Pine64 RK3566 Quartz64-A Board
> Net:   No ethernet found.
>
> Hit any key to stop autoboot:  0
> =>


 I just tried booting U-Boot v2023.10-rc2 with 
 ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and BL31=rk3568_bl31_v1.43.elf, 
 on my Quartz64-A but it fails during
 loading of some parts. I removed the output of the RK TPL from my logs as 
 there were no errors.
>>>
>>> Try with latest rk3566_ddr_1056MHz_v1.18.bin and see if that makes any
>>> difference.
>>
>> No difference.
>>
>> I've also checked, there is no other maskrom bootable media such as SPI 
>> flash connected to the board.
>>
>>>
 This is when booting from eMMC.
>>>
>>> Does it boot with SD-card or other eMMC modules?
>>
>> Booting from SD card (without eMMC connected), everything works fine.
>>
>>>
>>
 I also tried building your branch from 
 https://github.com/Kwiboo/u-boot-rockchip/tree/rk3568-2023.10 
>>>
>>> Please try with a GitHub actions built u-boot-rockchip.bin based on my
>>> rk3568-2023.07.02 branch at
>>> https://github.com/Kwiboo/u-boot-build/actions/runs/561235
>>
>> With that exact artifact, flashed with:
>>
>>> rkdeveloptool db rk356x_spl_loader_v1.18.113.bin
>>> rkdeveloptool ef
>>> rkdeveloptool wl 64 u-boot-rockchip.bin
>>> rkdeveloptool rd
>>
>> it fails to boot with with:
>>
>>> DDR V1.18 f366f69a7d typ 23/07/17-15:48:58
>>> ln
>>> LP4/4x derate en, other dram:1x trefi
>>> SRX
>>> ddrconfig:7
>>> LPDDR4X, 324MHz
>>> BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB
>>>
>>> change to: 324MHz
>>> clk skew:0x60
>>>
>>> change to: 528MHz
>>> clk skew:0x58
>>>
>>> change to: 780MHz
>>> clk skew:0x58
>>>
>>> change to: 1056MHz(final freq)
>>> clk skew:0x32
>>> out
>>>
>>> U-Boot SPL 2023.07.02-g09919887 (Aug 06 2023 - 16:59:31 +)
>>> Trying to boot from MMC1
>>> spl: mmc init failed with error: -70
>>> Trying to boot from MMC2
>>> Card did not respond to voltage select! : -110
>>> spl: mmc init failed with error: -95
>>> Trying to boot from MMC1
>>> mmc fail to send stop cmd
>>> mmc_load_image_raw_sector: mmc block read error
>>> SPL: failed to boot from all boot devices
>>> ### ERROR ### Please RESET the board ###
>>
>> I also tried a second eMMC, but it also failed to boot with the same "mmc 
>> block read error" message.
> 
> 
> I tried with your latest branch 
> https://github.com/Kwiboo/u-boot-rockchip/commits/rk3568-2023.10
> 
> and this time a different error message, loading from the eMMC appears to get 
> a bit further:
> 
>> U-Boot SPL 2023.10-00054-gef68159087 (Oct 12 2023 - 12:14:22 +0100)
>> Trying to boot from MMC1
>> ## Checking hash(es) for config config-1 ... OK
>> ## Checking hash(es) for Image atf-1 ... sha256+ OK
>> spl_load_simple_fit: can't load image loadables index 0 (ret = -5)
>> mmc_load_image_raw_sector: mmc block read error
>> Trying to boot from MMC2
>> Card did not respond to voltage select! : -110
>> spl: mmc init failed with error: -95
>> Trying to boot from MMC1
>> mmc_load_image_raw_sector: mmc block read error
>> SPL: failed to boot from all boot devices
>> ### ERROR ### Please RESET the board ###
> 
> So this is pointing to an issue reading from the MMC...
> 
> I found https:

Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-10-14 Thread Jonas Karlman
On 2023-10-14 20:58, Jonas Karlman wrote:
> Hi Christopher,
> 
> On 2023-10-12 13:46, Christopher Obbard wrote:
>> Hi Jonas,
>>
>> On Thu, 2023-10-12 at 10:51 +0100, Christopher Obbard wrote:
>>> Hi Jonas,
>>>
>>> Sorry for the late response, I've been meaning to test this for a while but 
>>> not got around to it.
>>>
>>> On Thu, 2023-08-17 at 23:56 +, Jonas Karlman wrote:
 Hi Christopher,

 On 2023-08-08 16:25, Christopher Obbard wrote:
> Hi Jonas,
>
> On Sun, 2023-07-23 at 15:04 +, Jonas Karlman wrote:
>> On 2023-07-23 16:55, Jonas Karlman wrote:
>>> The Pine64 Quartz64 Model A is a single-board computer based on the
>>> Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, USB2.0,
>>> CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
>>> 20 pin GPIO header.
>>>
>>> Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
>>> - SD-card boot
>>> - eMMC boot
>>> - PCIe/NVMe/AHCI
>>> - USB host
>>>
>>> Device tree is imported from linux v6.4.
>>>
>>> Co-developed-by: Nicolas Frattaroli 
>>> Signed-off-by: Nicolas Frattaroli 
>>> Signed-off-by: Jonas Karlman 
>>> ---
>>
>> [...]
>>
>> Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
>> BL31=rk3568_bl31_v1.43.elf:
>>
>> [...]
>>
>> U-Boot 2023.07 (Jul 23 2023 - 12:42:18 +)
>>
>> Model: Pine64 RK3566 Quartz64-A Board
>> DRAM:  8 GiB (effective 7.7 GiB)
>> PMIC:  RK8170 (on=0x10, off=0x00)
>> Core:  321 devices, 27 uclasses, devicetree: separate
>> MMC:   rockchip_sdhci_probe clk set rate fail!
>> mmc@fe2b: 1, mmc@fe2c: 2, mmc@fe31: 0
>> Loading Environment from nowhere... OK
>> In:    serial@fe66
>> Out:   serial@fe66
>> Err:   serial@fe66
>> Model: Pine64 RK3566 Quartz64-A Board
>> Net:   No ethernet found.
>>
>> Hit any key to stop autoboot:  0
>> =>
>
>
> I just tried booting U-Boot v2023.10-rc2 with 
> ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and BL31=rk3568_bl31_v1.43.elf, 
> on my Quartz64-A but it fails during
> loading of some parts. I removed the output of the RK TPL from my logs as 
> there were no errors.

 Try with latest rk3566_ddr_1056MHz_v1.18.bin and see if that makes any
 difference.
>>>
>>> No difference.
>>>
>>> I've also checked, there is no other maskrom bootable media such as SPI 
>>> flash connected to the board.
>>>

> This is when booting from eMMC.

 Does it boot with SD-card or other eMMC modules?
>>>
>>> Booting from SD card (without eMMC connected), everything works fine.
>>>

>>>
> I also tried building your branch from 
> https://github.com/Kwiboo/u-boot-rockchip/tree/rk3568-2023.10 

 Please try with a GitHub actions built u-boot-rockchip.bin based on my
 rk3568-2023.07.02 branch at
 https://github.com/Kwiboo/u-boot-build/actions/runs/561235
>>>
>>> With that exact artifact, flashed with:
>>>
 rkdeveloptool db rk356x_spl_loader_v1.18.113.bin
 rkdeveloptool ef
 rkdeveloptool wl 64 u-boot-rockchip.bin
 rkdeveloptool rd
>>>
>>> it fails to boot with with:
>>>
 DDR V1.18 f366f69a7d typ 23/07/17-15:48:58
 ln
 LP4/4x derate en, other dram:1x trefi
 SRX
 ddrconfig:7
 LPDDR4X, 324MHz
 BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB

 change to: 324MHz
 clk skew:0x60

 change to: 528MHz
 clk skew:0x58

 change to: 780MHz
 clk skew:0x58

 change to: 1056MHz(final freq)
 clk skew:0x32
 out

 U-Boot SPL 2023.07.02-g09919887 (Aug 06 2023 - 16:59:31 +)
 Trying to boot from MMC1
 spl: mmc init failed with error: -70
 Trying to boot from MMC2
 Card did not respond to voltage select! : -110
 spl: mmc init failed with error: -95
 Trying to boot from MMC1
 mmc fail to send stop cmd
 mmc_load_image_raw_sector: mmc block read error
 SPL: failed to boot from all boot devices
 ### ERROR ### Please RESET the board ###
>>>
>>> I also tried a second eMMC, but it also failed to boot with the same "mmc 
>>> block read error" message.
>>
>>
>> I tried with your latest branch 
>> https://github.com/Kwiboo/u-boot-rockchip/commits/rk3568-2023.10
>>
>> and this time a different error message, loading from the eMMC appears to 
>> get a bit further:
>>
>>> U-Boot SPL 2023.10-00054-gef68159087 (Oct 12 2023 - 12:14:22 +0100)
>>> Trying to boot from MMC1
>>> ## Checking hash(es) for config config-1 ... OK
>>> ## Checking hash(es) for Image atf-1 ... sha256+ OK
>>> spl_load_simple_fit: can't load image loadables index 0 (ret = -5)
>>> mmc_load_image_raw_sector: mmc block read error
>>> Trying to boot from MMC2
>>> Card did not respond to voltage select! : -110
>>> spl: mmc init failed with error: -95
>>> Trying to boot from MMC1
>>> mmc_load_image_raw_se

Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-10-12 Thread Christopher Obbard
Hi Jonas,

On Thu, 2023-10-12 at 10:51 +0100, Christopher Obbard wrote:
> Hi Jonas,
> 
> Sorry for the late response, I've been meaning to test this for a while but 
> not got around to it.
> 
> On Thu, 2023-08-17 at 23:56 +, Jonas Karlman wrote:
> > Hi Christopher,
> > 
> > On 2023-08-08 16:25, Christopher Obbard wrote:
> > > Hi Jonas,
> > > 
> > > On Sun, 2023-07-23 at 15:04 +, Jonas Karlman wrote:
> > > > On 2023-07-23 16:55, Jonas Karlman wrote:
> > > > > The Pine64 Quartz64 Model A is a single-board computer based on the
> > > > > Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, 
> > > > > USB2.0,
> > > > > CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
> > > > > 20 pin GPIO header.
> > > > > 
> > > > > Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
> > > > > - SD-card boot
> > > > > - eMMC boot
> > > > > - PCIe/NVMe/AHCI
> > > > > - USB host
> > > > > 
> > > > > Device tree is imported from linux v6.4.
> > > > > 
> > > > > Co-developed-by: Nicolas Frattaroli 
> > > > > Signed-off-by: Nicolas Frattaroli 
> > > > > Signed-off-by: Jonas Karlman 
> > > > > ---
> > > > 
> > > > [...]
> > > > 
> > > > Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
> > > > BL31=rk3568_bl31_v1.43.elf:
> > > > 
> > > > [...]
> > > > 
> > > > U-Boot 2023.07 (Jul 23 2023 - 12:42:18 +)
> > > > 
> > > > Model: Pine64 RK3566 Quartz64-A Board
> > > > DRAM:  8 GiB (effective 7.7 GiB)
> > > > PMIC:  RK8170 (on=0x10, off=0x00)
> > > > Core:  321 devices, 27 uclasses, devicetree: separate
> > > > MMC:   rockchip_sdhci_probe clk set rate fail!
> > > > mmc@fe2b: 1, mmc@fe2c: 2, mmc@fe31: 0
> > > > Loading Environment from nowhere... OK
> > > > In:    serial@fe66
> > > > Out:   serial@fe66
> > > > Err:   serial@fe66
> > > > Model: Pine64 RK3566 Quartz64-A Board
> > > > Net:   No ethernet found.
> > > > 
> > > > Hit any key to stop autoboot:  0
> > > > =>
> > > 
> > > 
> > > I just tried booting U-Boot v2023.10-rc2 with 
> > > ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and BL31=rk3568_bl31_v1.43.elf, 
> > > on my Quartz64-A but it fails during
> > > loading of some parts. I removed the output of the RK TPL from my logs as 
> > > there were no errors.
> > 
> > Try with latest rk3566_ddr_1056MHz_v1.18.bin and see if that makes any
> > difference.
> 
> No difference.
> 
> I've also checked, there is no other maskrom bootable media such as SPI flash 
> connected to the board.
> 
> > 
> > > This is when booting from eMMC.
> > 
> > Does it boot with SD-card or other eMMC modules?
> 
> Booting from SD card (without eMMC connected), everything works fine.
> 
> > 
> 
> > > I also tried building your branch from 
> > > https://github.com/Kwiboo/u-boot-rockchip/tree/rk3568-2023.10 and 
> > 
> > Please try with a GitHub actions built u-boot-rockchip.bin based on my
> > rk3568-2023.07.02 branch at
> > https://github.com/Kwiboo/u-boot-build/actions/runs/561235
> 
> With that exact artifact, flashed with:
> 
> > rkdeveloptool db rk356x_spl_loader_v1.18.113.bin
> > rkdeveloptool ef
> > rkdeveloptool wl 64 u-boot-rockchip.bin
> > rkdeveloptool rd
> 
> it fails to boot with with:
> 
> > DDR V1.18 f366f69a7d typ 23/07/17-15:48:58
> > ln
> > LP4/4x derate en, other dram:1x trefi
> > SRX
> > ddrconfig:7
> > LPDDR4X, 324MHz
> > BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB
> > 
> > change to: 324MHz
> > clk skew:0x60
> > 
> > change to: 528MHz
> > clk skew:0x58
> > 
> > change to: 780MHz
> > clk skew:0x58
> > 
> > change to: 1056MHz(final freq)
> > clk skew:0x32
> > out
> > 
> > U-Boot SPL 2023.07.02-g09919887 (Aug 06 2023 - 16:59:31 +)
> > Trying to boot from MMC1
> > spl: mmc init failed with error: -70
> > Trying to boot from MMC2
> > Card did not respond to voltage select! : -110
> > spl: mmc init failed with error: -95
> > Trying to boot from MMC1
> > mmc fail to send stop cmd
> > mmc_load_image_raw_sector: mmc block read error
> > SPL: failed to boot from all boot devices
> > ### ERROR ### Please RESET the board ###
> 
> I also tried a second eMMC, but it also failed to boot with the same "mmc 
> block read error" message.


I tried with your latest branch 
https://github.com/Kwiboo/u-boot-rockchip/commits/rk3568-2023.10

and this time a different error message, loading from the eMMC appears to get a 
bit further:

> U-Boot SPL 2023.10-00054-gef68159087 (Oct 12 2023 - 12:14:22 +0100)
> Trying to boot from MMC1
> ## Checking hash(es) for config config-1 ... OK
> ## Checking hash(es) for Image atf-1 ... sha256+ OK
> spl_load_simple_fit: can't load image loadables index 0 (ret = -5)
> mmc_load_image_raw_sector: mmc block read error
> Trying to boot from MMC2
> Card did not respond to voltage select! : -110
> spl: mmc init failed with error: -95
> Trying to boot from MMC1
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

So this is pointing to an issue read

Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-10-12 Thread Christopher Obbard
Hi Jonas,

Sorry for the late response, I've been meaning to test this for a while but not 
got around to it.

On Thu, 2023-08-17 at 23:56 +, Jonas Karlman wrote:
> Hi Christopher,
> 
> On 2023-08-08 16:25, Christopher Obbard wrote:
> > Hi Jonas,
> > 
> > On Sun, 2023-07-23 at 15:04 +, Jonas Karlman wrote:
> > > On 2023-07-23 16:55, Jonas Karlman wrote:
> > > > The Pine64 Quartz64 Model A is a single-board computer based on the
> > > > Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, USB2.0,
> > > > CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
> > > > 20 pin GPIO header.
> > > > 
> > > > Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
> > > > - SD-card boot
> > > > - eMMC boot
> > > > - PCIe/NVMe/AHCI
> > > > - USB host
> > > > 
> > > > Device tree is imported from linux v6.4.
> > > > 
> > > > Co-developed-by: Nicolas Frattaroli 
> > > > Signed-off-by: Nicolas Frattaroli 
> > > > Signed-off-by: Jonas Karlman 
> > > > ---
> > > 
> > > [...]
> > > 
> > > Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
> > > BL31=rk3568_bl31_v1.43.elf:
> > > 
> > > [...]
> > > 
> > > U-Boot 2023.07 (Jul 23 2023 - 12:42:18 +)
> > > 
> > > Model: Pine64 RK3566 Quartz64-A Board
> > > DRAM:  8 GiB (effective 7.7 GiB)
> > > PMIC:  RK8170 (on=0x10, off=0x00)
> > > Core:  321 devices, 27 uclasses, devicetree: separate
> > > MMC:   rockchip_sdhci_probe clk set rate fail!
> > > mmc@fe2b: 1, mmc@fe2c: 2, mmc@fe31: 0
> > > Loading Environment from nowhere... OK
> > > In:    serial@fe66
> > > Out:   serial@fe66
> > > Err:   serial@fe66
> > > Model: Pine64 RK3566 Quartz64-A Board
> > > Net:   No ethernet found.
> > > 
> > > Hit any key to stop autoboot:  0
> > > =>
> > 
> > 
> > I just tried booting U-Boot v2023.10-rc2 with 
> > ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and BL31=rk3568_bl31_v1.43.elf, 
> > on my Quartz64-A but it fails during
> > loading of some parts. I removed the output of the RK TPL from my logs as 
> > there were no errors.
> 
> Try with latest rk3566_ddr_1056MHz_v1.18.bin and see if that makes any
> difference.

No difference.

I've also checked, there is no other maskrom bootable media such as SPI flash 
connected to the board.

> 
> > This is when booting from eMMC.
> 
> Does it boot with SD-card or other eMMC modules?

Booting from SD card (without eMMC connected), everything works fine.

> 

> > I also tried building your branch from 
> > https://github.com/Kwiboo/u-boot-rockchip/tree/rk3568-2023.10 and 
> 
> Please try with a GitHub actions built u-boot-rockchip.bin based on my
> rk3568-2023.07.02 branch at
> https://github.com/Kwiboo/u-boot-build/actions/runs/561235

With that exact artifact, flashed with:

> rkdeveloptool db rk356x_spl_loader_v1.18.113.bin
> rkdeveloptool ef
> rkdeveloptool wl 64 u-boot-rockchip.bin
> rkdeveloptool rd

it fails to boot with with:

> DDR V1.18 f366f69a7d typ 23/07/17-15:48:58
> ln
> LP4/4x derate en, other dram:1x trefi
> SRX
> ddrconfig:7
> LPDDR4X, 324MHz
> BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB
> 
> change to: 324MHz
> clk skew:0x60
> 
> change to: 528MHz
> clk skew:0x58
> 
> change to: 780MHz
> clk skew:0x58
> 
> change to: 1056MHz(final freq)
> clk skew:0x32
> out
> 
> U-Boot SPL 2023.07.02-g09919887 (Aug 06 2023 - 16:59:31 +)
> Trying to boot from MMC1
> spl: mmc init failed with error: -70
> Trying to boot from MMC2
> Card did not respond to voltage select! : -110
> spl: mmc init failed with error: -95
> Trying to boot from MMC1
> mmc fail to send stop cmd
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

I also tried a second eMMC, but it also failed to boot with the same "mmc block 
read error" message.


> 
> What happens if you write u-boot-rockchip.bin to eMMC module usinga USB 
> adapter:
> 
>   dd if=u-boot-rockchip.bin of=/dev/ bs=32k seek=1 conv=fsync
> 
> or using U-Boot cmd when booted from a SD-card?
> 
>   # Read u-boot-rockchip.bin from first partition of a SD card
>   load mmc 1:1 1000 u-boot-rockchip.bin
> 
>   # Change to eMMC
>   mmc dev 0
> 
>   # Write 10 MiB (0x5000 blocks) at sector 64 (0x40)
>   mmc write $fileaddr 40 5000
> 
> Does that make any difference?

I don't think I have an eMMC writer for Pine64 eMMCs, I will try to get hold of 
one this week.
But it fails to write to the eMMC with:

> => load mmc 1:2 1000 u-boot-rockchip.bin
> 9510400 bytes read in 791 ms (11.5 MiB/s)
> 
> => mmc dev 0
> switch to partitions #0, OK
> mmc0(part 0) is current device
> 
> 
> => mmc write $fileaddr 40 5000
> MMC write: dev # 0, block # 64, count 20480 ... mmc write failed
> 0 blocks written: ERROR
> 
> => mmc info
> Device: mmc@fe31
> Manufacturer ID: 45
> OEM: 0
> Name: DF4016 
> Bus Speed: 5200
> Mode: MMC DDR52 (52MHz)
> Rd Block Len: 512
> MMC version 5.1
> High Capacity: Yes
> Capacity: 14.7 GiB
> Bus Width: 8-bit DDR
> Erase 

Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-08-17 Thread Jonas Karlman
Hi Christopher,

On 2023-08-08 16:25, Christopher Obbard wrote:
> Hi Jonas,
> 
> On Sun, 2023-07-23 at 15:04 +, Jonas Karlman wrote:
>> On 2023-07-23 16:55, Jonas Karlman wrote:
>>> The Pine64 Quartz64 Model A is a single-board computer based on the
>>> Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, USB2.0,
>>> CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
>>> 20 pin GPIO header.
>>>
>>> Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
>>> - SD-card boot
>>> - eMMC boot
>>> - PCIe/NVMe/AHCI
>>> - USB host
>>>
>>> Device tree is imported from linux v6.4.
>>>
>>> Co-developed-by: Nicolas Frattaroli 
>>> Signed-off-by: Nicolas Frattaroli 
>>> Signed-off-by: Jonas Karlman 
>>> ---
>>
>> [...]
>>
>> Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
>> BL31=rk3568_bl31_v1.43.elf:
>>
>> [...]
>>
>> U-Boot 2023.07 (Jul 23 2023 - 12:42:18 +)
>>
>> Model: Pine64 RK3566 Quartz64-A Board
>> DRAM:  8 GiB (effective 7.7 GiB)
>> PMIC:  RK8170 (on=0x10, off=0x00)
>> Core:  321 devices, 27 uclasses, devicetree: separate
>> MMC:   rockchip_sdhci_probe clk set rate fail!
>> mmc@fe2b: 1, mmc@fe2c: 2, mmc@fe31: 0
>> Loading Environment from nowhere... OK
>> In:    serial@fe66
>> Out:   serial@fe66
>> Err:   serial@fe66
>> Model: Pine64 RK3566 Quartz64-A Board
>> Net:   No ethernet found.
>>
>> Hit any key to stop autoboot:  0
>> =>
> 
> 
> I just tried booting U-Boot v2023.10-rc2 with 
> ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and BL31=rk3568_bl31_v1.43.elf, on 
> my Quartz64-A but it fails during
> loading of some parts. I removed the output of the RK TPL from my logs as 
> there were no errors.

Try with latest rk3566_ddr_1056MHz_v1.18.bin and see if that makes any
difference.

> 
> This is when booting from eMMC.

Does it boot with SD-card or other eMMC modules?

> 
> I also tried building your branch from 
> https://github.com/Kwiboo/u-boot-rockchip/tree/rk3568-2023.10 and 

Please try with a GitHub actions built u-boot-rockchip.bin based on my
rk3568-2023.07.02 branch at
https://github.com/Kwiboo/u-boot-build/actions/runs/561235

> 
> 
> The full build commands:
> 
> export ROCKCHIP_TPL=rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.17.bin
> export BL31=rkbin/bin/rk35/rk3568_bl31_v1.43.elf
> make quartz64-a-rk3566_defconfig
> make -j16
> 
> rkdeveloptool db rk356x_spl_loader_v1.13.112.bin
> rkdeveloptool wl 64 u-boot-rockchip.bin

What happens if you write u-boot-rockchip.bin to eMMC module usinga USB adapter:

  dd if=u-boot-rockchip.bin of=/dev/ bs=32k seek=1 conv=fsync

or using U-Boot cmd when booted from a SD-card?

  # Read u-boot-rockchip.bin from first partition of a SD card
  load mmc 1:1 1000 u-boot-rockchip.bin

  # Change to eMMC
  mmc dev 0

  # Write 10 MiB (0x5000 blocks) at sector 64 (0x40)
  mmc write $fileaddr 40 5000

Does that make any difference?

> 
> Boot log (v2023.10-rc2):
> 
> U-Boot SPL 2023.10-rc2 (Aug 08 2023 - 14:02:34 +0100)
> rockchip_sdhci_probe clk set rate fail!
> Trying to boot from MMC1
> spl: mmc init failed with error: -110
> Trying to boot from MMC2
> Card did not respond to voltage select! : -110
> spl: mmc init failed with error: -95
> Trying to boot from MMC1

Strange that second try of eMMC (MMC1) gets little bit longer.

> ## Checking hash(es) for config config-1 ... OK
> ## Checking hash(es) for Image atf-1 ... sha256+ OK
> spl_load_simple_fit: can't load image loadables index 0 (ret = -5)
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
> 
> 
> Boot log (your branch):
> 
> U-Boot SPL 2023.10-rc1-00368-g16cb31d427 (Aug 08 2023 - 15:17:35 +0100)
> Trying to boot from MMC1
> spl: mmc init failed with error: -70
> Trying to boot from MMC2
> Card did not respond to voltage select! : -110
> spl: mmc init failed with error: -95
> Trying to boot from MMC1
> ## Checking hash(es) for config config-1 ... OK
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

I have not been able to reproduce this kind of issue on any of my two
Quartz64-A boards, tested with different eMMC modules.

Does your eMMC module have some compatibility issue?
Do you have any more details on the eMMC module you have tested with?

There was also some clk and pinctrl changes recently merged into master
branch, but they was probably included in the build from my branch based
on the lack of "rockchip_sdhci_probe clk set rate fail!" message.

Regards,
Jonas

> 
> 
> Thanks!
> 
> Chris
> 



Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-08-08 Thread Christopher Obbard
Hi Jonas,

On Sun, 2023-07-23 at 15:04 +, Jonas Karlman wrote:
> On 2023-07-23 16:55, Jonas Karlman wrote:
> > The Pine64 Quartz64 Model A is a single-board computer based on the
> > Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, USB2.0,
> > CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
> > 20 pin GPIO header.
> > 
> > Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
> > - SD-card boot
> > - eMMC boot
> > - PCIe/NVMe/AHCI
> > - USB host
> > 
> > Device tree is imported from linux v6.4.
> > 
> > Co-developed-by: Nicolas Frattaroli 
> > Signed-off-by: Nicolas Frattaroli 
> > Signed-off-by: Jonas Karlman 
> > ---
> 
> [...]
> 
> Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
> BL31=rk3568_bl31_v1.43.elf:
> 
> [...]
> 
> U-Boot 2023.07 (Jul 23 2023 - 12:42:18 +)
> 
> Model: Pine64 RK3566 Quartz64-A Board
> DRAM:  8 GiB (effective 7.7 GiB)
> PMIC:  RK8170 (on=0x10, off=0x00)
> Core:  321 devices, 27 uclasses, devicetree: separate
> MMC:   rockchip_sdhci_probe clk set rate fail!
> mmc@fe2b: 1, mmc@fe2c: 2, mmc@fe31: 0
> Loading Environment from nowhere... OK
> In:    serial@fe66
> Out:   serial@fe66
> Err:   serial@fe66
> Model: Pine64 RK3566 Quartz64-A Board
> Net:   No ethernet found.
> 
> Hit any key to stop autoboot:  0
> =>


I just tried booting U-Boot v2023.10-rc2 with 
ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and BL31=rk3568_bl31_v1.43.elf, on my 
Quartz64-A but it fails during
loading of some parts. I removed the output of the RK TPL from my logs as there 
were no errors.

This is when booting from eMMC.

I also tried building your branch from 
https://github.com/Kwiboo/u-boot-rockchip/tree/rk3568-2023.10 and 


The full build commands:

export ROCKCHIP_TPL=rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.17.bin
export BL31=rkbin/bin/rk35/rk3568_bl31_v1.43.elf
make quartz64-a-rk3566_defconfig
make -j16

rkdeveloptool db rk356x_spl_loader_v1.13.112.bin
rkdeveloptool wl 64 u-boot-rockchip.bin

Boot log (v2023.10-rc2):

U-Boot SPL 2023.10-rc2 (Aug 08 2023 - 14:02:34 +0100)
rockchip_sdhci_probe clk set rate fail!
Trying to boot from MMC1
spl: mmc init failed with error: -110
Trying to boot from MMC2
Card did not respond to voltage select! : -110
spl: mmc init failed with error: -95
Trying to boot from MMC1
## Checking hash(es) for config config-1 ... OK
## Checking hash(es) for Image atf-1 ... sha256+ OK
spl_load_simple_fit: can't load image loadables index 0 (ret = -5)
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###


Boot log (your branch):

U-Boot SPL 2023.10-rc1-00368-g16cb31d427 (Aug 08 2023 - 15:17:35 +0100)
Trying to boot from MMC1
spl: mmc init failed with error: -70
Trying to boot from MMC2
Card did not respond to voltage select! : -110
spl: mmc init failed with error: -95
Trying to boot from MMC1
## Checking hash(es) for config config-1 ... OK
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###


Thanks!

Chris



Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-07-25 Thread Kever Yang



On 2023/7/23 22:55, Jonas Karlman wrote:

The Pine64 Quartz64 Model A is a single-board computer based on the
Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, USB2.0,
CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
20 pin GPIO header.

Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
- SD-card boot
- eMMC boot
- PCIe/NVMe/AHCI
- USB host

Device tree is imported from linux v6.4.

Co-developed-by: Nicolas Frattaroli 
Signed-off-by: Nicolas Frattaroli 
Signed-off-by: Jonas Karlman 

Reviewed-by: Kever Yang 

Thanks,
- Kever

---
  arch/arm/dts/Makefile |   1 +
  arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi|  55 ++
  arch/arm/dts/rk3566-quartz64-a.dts| 839 ++
  arch/arm/mach-rockchip/rk3568/Kconfig |   6 +
  board/pine64/quartz64_rk3566/Kconfig  |  15 +
  board/pine64/quartz64_rk3566/MAINTAINERS  |   9 +
  board/pine64/quartz64_rk3566/Makefile |   3 +
  .../pine64/quartz64_rk3566/quartz64-rk3566.c  |   1 +
  configs/quartz64-a-rk3566_defconfig   | 110 +++
  doc/board/rockchip/rockchip.rst   |   1 +
  include/configs/quartz64_rk3566.h |  10 +
  11 files changed, 1050 insertions(+)
  create mode 100644 arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi
  create mode 100644 arch/arm/dts/rk3566-quartz64-a.dts
  create mode 100644 board/pine64/quartz64_rk3566/Kconfig
  create mode 100644 board/pine64/quartz64_rk3566/MAINTAINERS
  create mode 100644 board/pine64/quartz64_rk3566/Makefile
  create mode 100644 board/pine64/quartz64_rk3566/quartz64-rk3566.c
  create mode 100644 configs/quartz64-a-rk3566_defconfig
  create mode 100644 include/configs/quartz64_rk3566.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 6764ded580ab..45ef73fdf0ca 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -167,6 +167,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
  
  dtb-$(CONFIG_ROCKCHIP_RK3568) += \

rk3566-anbernic-rgxx3.dtb \
+   rk3566-quartz64-a.dtb \
rk3566-radxa-cm3-io.dtb \
rk3568-evb.dtb \
rk3568-odroid-m1.dtb \
diff --git a/arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi 
b/arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi
new file mode 100644
index ..700c2d3edfe6
--- /dev/null
+++ b/arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include "rk356x-u-boot.dtsi"
+
+/ {
+   chosen {
+   stdout-path = &uart2;
+   };
+};
+
+&gpio0 {
+   bootph-all;
+};
+
+&pcie2x1 {
+   pinctrl-0 = <&pcie20m2_pins &pcie_reset_h>;
+};
+
+&sdhci {
+   cap-mmc-highspeed;
+   mmc-ddr-1_8v;
+   pinctrl-names = "default";
+   pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
+};
+
+&sfc {
+   bootph-pre-ram;
+   u-boot,spl-sfc-no-dma;
+
+   flash@0 {
+   bootph-pre-ram;
+   };
+};
+
+&uart2 {
+   bootph-all;
+   clock-frequency = <2400>;
+   status = "okay";
+};
+
+/*
+ * U-Boot does not support multiple regulators using the same gpio,
+ * use vcc5v0_usb20_host to fix use of USB 2.0 port
+ */
+&usb2phy0_otg {
+   phy-supply = <&vcc5v0_usb20_host>;
+};
+
+&vcc3v3_sd {
+   bootph-pre-ram;
+};
+
+&vcc_sd_h {
+   bootph-all;
+};
diff --git a/arch/arm/dts/rk3566-quartz64-a.dts 
b/arch/arm/dts/rk3566-quartz64-a.dts
new file mode 100644
index ..25a8c781f4e7
--- /dev/null
+++ b/arch/arm/dts/rk3566-quartz64-a.dts
@@ -0,0 +1,839 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include 
+#include 
+#include 
+#include "rk3566.dtsi"
+
+/ {
+   model = "Pine64 RK3566 Quartz64-A Board";
+   compatible = "pine64,quartz64-a", "rockchip,rk3566";
+
+   aliases {
+   ethernet0 = &gmac1;
+   mmc0 = &sdmmc0;
+   mmc1 = &sdhci;
+   };
+
+   chosen: chosen {
+   stdout-path = "serial2:150n8";
+   };
+
+   gmac1_clkin: external-gmac1-clock {
+   compatible = "fixed-clock";
+   clock-frequency = <12500>;
+   clock-output-names = "gmac1_clkin";
+   #clock-cells = <0>;
+   };
+
+   fan: gpio_fan {
+   compatible = "gpio-fan";
+   gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>;
+   gpio-fan,speed-map = <00
+ 4500 1>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&fan_en_h>;
+   #cooling-cells = <2>;
+   };
+
+   hdmi-con {
+   compatible = "hdmi-connector";
+   type = "a";
+
+   port {
+   hdmi_con_in: endpoint {
+   remote-endpoint = <&hdmi_out_con>;
+   };
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   led-work {
+   label = "work-led";
+   

Re: [PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-07-23 Thread Jonas Karlman
On 2023-07-23 16:55, Jonas Karlman wrote:
> The Pine64 Quartz64 Model A is a single-board computer based on the
> Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, USB2.0,
> CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
> 20 pin GPIO header.
> 
> Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
> - SD-card boot
> - eMMC boot
> - PCIe/NVMe/AHCI
> - USB host
> 
> Device tree is imported from linux v6.4.
> 
> Co-developed-by: Nicolas Frattaroli 
> Signed-off-by: Nicolas Frattaroli 
> Signed-off-by: Jonas Karlman 
> ---

[...]

Boot log with ROCKCHIP_TPL=rk3566_ddr_1056MHz_v1.17.bin and
BL31=rk3568_bl31_v1.43.elf:

DDR V1.17 992b933606 typ 23/04/25-10:10:19
ln
LP4/4x derate en, other dram:1x trefi
ddrconfig:7
LPDDR4X, 324MHz
BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=8192MB
tdqss: cs0 dqs0: 72ps, dqs1: -96ps, dqs2: -48ps, dqs3: -144ps,
tdqss: cs1 dqs0: 48ps, dqs1: -96ps, dqs2: -48ps, dqs3: -120ps,

change to: 324MHz
clk skew:0x61

change to: 528MHz
clk skew:0x58

change to: 780MHz
clk skew:0x58

change to: 1056MHz(final freq)
PHY drv:clk:36,ca:36,DQ:29,odt:60
vrefinner:16%, vrefout:22%
dram drv:40,odt:80
vref_ca:0071
clk skew:0x2f
cs 0:
the read training result:
DQS0:0x3e, DQS1:0x3d, DQS2:0x42, DQS3:0x3a,
min  : 0xd  0xe  0xe  0xd  0x1  0x2  0x5  0x1 , 0x6  0x7  0x2  0x1  0xa  0x9  
0xe  0x9 ,
  0x10  0xf  0xe  0xa  0x6  0x1  0x1  0x4 , 0xb  0x8  0x4  0x1  0xd  0xa  
0x9  0xc ,
mid  :0x2b 0x2c 0x2d 0x2c 0x20 0x22 0x24 0x20 ,0x26 0x26 0x22 0x20 0x2a 0x29 
0x2c 0x29 ,
  0x30 0x2f 0x2d 0x29 0x25 0x20 0x21 0x23 ,0x2a 0x26 0x24 0x20 0x2c 0x29 
0x28 0x2b ,
max  :0x49 0x4a 0x4d 0x4c 0x40 0x42 0x43 0x40 ,0x46 0x46 0x43 0x40 0x4b 0x49 
0x4b 0x49 ,
  0x51 0x50 0x4c 0x49 0x45 0x3f 0x41 0x43 ,0x49 0x45 0x44 0x40 0x4c 0x49 
0x47 0x4a ,
range:0x3c 0x3c 0x3f 0x3f 0x3f 0x40 0x3e 0x3f ,0x40 0x3f 0x41 0x3f 0x41 0x40 
0x3d 0x40 ,
  0x41 0x41 0x3e 0x3f 0x3f 0x3e 0x40 0x3f ,0x3e 0x3d 0x40 0x3f 0x3f 0x3f 
0x3e 0x3e ,
the write training result:
DQS0:0x38, DQS1:0x23, DQS2:0x29, DQS3:0x1c,
min  :0x64 0x67 0x68 0x68 0x5b 0x5d 0x5f 0x64 0x62 ,0x4c 0x4d 0x48 0x48 0x50 
0x50 0x52 0x50 0x4e ,
  0x54 0x53 0x51 0x50 0x4c 0x4a 0x4a 0x4e 0x4f ,0x47 0x46 0x44 0x41 0x4a 
0x4a 0x48 0x4c 0x45 ,
mid  :0x81 0x83 0x84 0x83 0x77 0x79 0x7c 0x7d 0x7c ,0x6a 0x6a 0x64 0x63 0x6c 
0x6b 0x6c 0x6b 0x69 ,
  0x72 0x71 0x6d 0x6d 0x68 0x61 0x62 0x69 0x6a ,0x65 0x60 0x5f 0x5c 0x65 
0x66 0x61 0x68 0x60 ,
max  :0x9e 0xa0 0xa1 0x9e 0x93 0x95 0x99 0x96 0x96 ,0x88 0x87 0x81 0x7e 0x88 
0x87 0x87 0x87 0x85 ,
  0x90 0x8f 0x89 0x8a 0x84 0x79 0x7b 0x85 0x86 ,0x83 0x7b 0x7a 0x77 0x81 
0x82 0x7b 0x85 0x7c ,
range:0x3a 0x39 0x39 0x36 0x38 0x38 0x3a 0x32 0x34 ,0x3c 0x3a 0x39 0x36 0x38 
0x37 0x35 0x37 0x37 ,
  0x3c 0x3c 0x38 0x3a 0x38 0x2f 0x31 0x37 0x37 ,0x3c 0x35 0x36 0x36 0x37 
0x38 0x33 0x39 0x37 ,
cs 1:
the read training result:
DQS0:0x3c, DQS1:0x3d, DQS2:0x42, DQS3:0x3b,
min  : 0xc  0xc  0xd  0xc  0x1  0x2  0x6  0x3 , 0x7  0x7  0x2  0x1  0x9  0x9  
0xd  0x9 ,
  0x10  0xf  0xe  0xb  0x7  0x1  0x2  0x5 , 0xa  0x9  0x6  0x1  0xd  0xc  
0xb  0xe ,
mid  :0x29 0x2a 0x2c 0x2a 0x20 0x21 0x24 0x20 ,0x26 0x26 0x22 0x21 0x2a 0x29 
0x2c 0x28 ,
  0x2f 0x2e 0x2c 0x2a 0x26 0x20 0x21 0x24 ,0x29 0x27 0x26 0x21 0x2d 0x2c 
0x2a 0x2d ,
max  :0x47 0x48 0x4b 0x49 0x3f 0x41 0x43 0x3e ,0x46 0x46 0x42 0x41 0x4b 0x49 
0x4b 0x48 ,
  0x4f 0x4e 0x4a 0x49 0x45 0x40 0x41 0x44 ,0x49 0x46 0x46 0x41 0x4d 0x4c 
0x49 0x4d ,
range:0x3b 0x3c 0x3e 0x3d 0x3e 0x3f 0x3d 0x3b ,0x3f 0x3f 0x40 0x40 0x42 0x40 
0x3e 0x3f ,
  0x3f 0x3f 0x3c 0x3e 0x3e 0x3f 0x3f 0x3f ,0x3f 0x3d 0x40 0x40 0x40 0x40 
0x3e 0x3f ,
the write training result:
DQS0:0x38, DQS1:0x23, DQS2:0x29, DQS3:0x1c,
min  :0x62 0x64 0x65 0x64 0x57 0x59 0x5d 0x5f 0x5c ,0x4b 0x4c 0x46 0x46 0x4e 
0x4e 0x52 0x4f 0x4c ,
  0x54 0x53 0x4f 0x4f 0x4b 0x47 0x49 0x4e 0x4e ,0x4a 0x4a 0x48 0x44 0x4e 
0x4c 0x4b 0x4f 0x49 ,
mid  :0x7f 0x80 0x81 0x80 0x74 0x76 0x7a 0x7a 0x78 ,0x68 0x68 0x62 0x61 0x69 
0x69 0x6c 0x6a 0x68 ,
  0x71 0x70 0x6b 0x6b 0x65 0x5f 0x62 0x67 0x69 ,0x68 0x65 0x61 0x5f 0x69 
0x69 0x64 0x6c 0x63 ,
max  :0x9c 0x9d 0x9e 0x9c 0x91 0x94 0x97 0x95 0x94 ,0x86 0x84 0x7e 0x7c 0x85 
0x85 0x86 0x85 0x84 ,
  0x8f 0x8d 0x88 0x88 0x80 0x78 0x7b 0x80 0x85 ,0x87 0x81 0x7a 0x7a 0x84 
0x87 0x7d 0x89 0x7e ,
range:0x3a 0x39 0x39 0x38 0x3a 0x3b 0x3a 0x36 0x38 ,0x3b 0x38 0x38 0x36 0x37 
0x37 0x34 0x36 0x38 ,
  0x3b 0x3a 0x39 0x39 0x35 0x31 0x32 0x32 0x37 ,0x3d 0x37 0x32 0x36 0x36 
0x3b 0x32 0x3a 0x35 ,
CA Training result:
cs:0 min  :0x51 0x50 0x4a 0x43 0x49 0x43 0x4c ,0x4e 0x49 0x48 0x42 0x47 0x3f 
0x49 ,
cs:0 mid  :0x8f 0x91 0x84 0x84 0x84 0x84 0x7b ,0x8a 0x89 0x83 0x82 0x82 0x80 
0x78 ,
cs:0 max  :0xcd 0xd2 0xbf 0xc6 0xc0 0xc5 0xab ,0xc6 0xc9 0xbf 0xc2 0xbd 0xc1 
0xa7 ,
cs:0 range:0x7c 0x82 0x75 0x83 0x77 0x82 0x5f ,0x78 0x80 0x77 0x80 0x76 0x82 
0x5e ,
cs:1 min  :0x4e 0x53 0x45 0x45 0x45 0x45 0x4a ,0x4a 0x4c 0x44 0x46 0x42 0x43 
0x48 ,
cs:1 mid  :0x8e

[PATCH 1/5] board: rockchip: Add Pine64 Quartz64-A Board

2023-07-23 Thread Jonas Karlman
The Pine64 Quartz64 Model A is a single-board computer based on the
Rockchip RK3566 SoC. The board features USB3, SATA, PCIe, HDMI, USB2.0,
CSI, DSI, eDP, eMMC, SD, and an e-paper parallel port, as well as a
20 pin GPIO header.

Features tested on a Quartz64-A 8GB v2.0 2021-04-27:
- SD-card boot
- eMMC boot
- PCIe/NVMe/AHCI
- USB host

Device tree is imported from linux v6.4.

Co-developed-by: Nicolas Frattaroli 
Signed-off-by: Nicolas Frattaroli 
Signed-off-by: Jonas Karlman 
---
 arch/arm/dts/Makefile |   1 +
 arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi|  55 ++
 arch/arm/dts/rk3566-quartz64-a.dts| 839 ++
 arch/arm/mach-rockchip/rk3568/Kconfig |   6 +
 board/pine64/quartz64_rk3566/Kconfig  |  15 +
 board/pine64/quartz64_rk3566/MAINTAINERS  |   9 +
 board/pine64/quartz64_rk3566/Makefile |   3 +
 .../pine64/quartz64_rk3566/quartz64-rk3566.c  |   1 +
 configs/quartz64-a-rk3566_defconfig   | 110 +++
 doc/board/rockchip/rockchip.rst   |   1 +
 include/configs/quartz64_rk3566.h |  10 +
 11 files changed, 1050 insertions(+)
 create mode 100644 arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3566-quartz64-a.dts
 create mode 100644 board/pine64/quartz64_rk3566/Kconfig
 create mode 100644 board/pine64/quartz64_rk3566/MAINTAINERS
 create mode 100644 board/pine64/quartz64_rk3566/Makefile
 create mode 100644 board/pine64/quartz64_rk3566/quartz64-rk3566.c
 create mode 100644 configs/quartz64-a-rk3566_defconfig
 create mode 100644 include/configs/quartz64_rk3566.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 6764ded580ab..45ef73fdf0ca 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -167,6 +167,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
 
 dtb-$(CONFIG_ROCKCHIP_RK3568) += \
rk3566-anbernic-rgxx3.dtb \
+   rk3566-quartz64-a.dtb \
rk3566-radxa-cm3-io.dtb \
rk3568-evb.dtb \
rk3568-odroid-m1.dtb \
diff --git a/arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi 
b/arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi
new file mode 100644
index ..700c2d3edfe6
--- /dev/null
+++ b/arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include "rk356x-u-boot.dtsi"
+
+/ {
+   chosen {
+   stdout-path = &uart2;
+   };
+};
+
+&gpio0 {
+   bootph-all;
+};
+
+&pcie2x1 {
+   pinctrl-0 = <&pcie20m2_pins &pcie_reset_h>;
+};
+
+&sdhci {
+   cap-mmc-highspeed;
+   mmc-ddr-1_8v;
+   pinctrl-names = "default";
+   pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
+};
+
+&sfc {
+   bootph-pre-ram;
+   u-boot,spl-sfc-no-dma;
+
+   flash@0 {
+   bootph-pre-ram;
+   };
+};
+
+&uart2 {
+   bootph-all;
+   clock-frequency = <2400>;
+   status = "okay";
+};
+
+/*
+ * U-Boot does not support multiple regulators using the same gpio,
+ * use vcc5v0_usb20_host to fix use of USB 2.0 port
+ */
+&usb2phy0_otg {
+   phy-supply = <&vcc5v0_usb20_host>;
+};
+
+&vcc3v3_sd {
+   bootph-pre-ram;
+};
+
+&vcc_sd_h {
+   bootph-all;
+};
diff --git a/arch/arm/dts/rk3566-quartz64-a.dts 
b/arch/arm/dts/rk3566-quartz64-a.dts
new file mode 100644
index ..25a8c781f4e7
--- /dev/null
+++ b/arch/arm/dts/rk3566-quartz64-a.dts
@@ -0,0 +1,839 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include 
+#include 
+#include 
+#include "rk3566.dtsi"
+
+/ {
+   model = "Pine64 RK3566 Quartz64-A Board";
+   compatible = "pine64,quartz64-a", "rockchip,rk3566";
+
+   aliases {
+   ethernet0 = &gmac1;
+   mmc0 = &sdmmc0;
+   mmc1 = &sdhci;
+   };
+
+   chosen: chosen {
+   stdout-path = "serial2:150n8";
+   };
+
+   gmac1_clkin: external-gmac1-clock {
+   compatible = "fixed-clock";
+   clock-frequency = <12500>;
+   clock-output-names = "gmac1_clkin";
+   #clock-cells = <0>;
+   };
+
+   fan: gpio_fan {
+   compatible = "gpio-fan";
+   gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>;
+   gpio-fan,speed-map = <00
+ 4500 1>;
+   pinctrl-names = "default";
+   pinctrl-0 = <&fan_en_h>;
+   #cooling-cells = <2>;
+   };
+
+   hdmi-con {
+   compatible = "hdmi-connector";
+   type = "a";
+
+   port {
+   hdmi_con_in: endpoint {
+   remote-endpoint = <&hdmi_out_con>;
+   };
+   };
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   led-work {
+   label = "work-led";
+   default-state = "off";
+   gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
+