u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Johan Jonker <jbx6244@gmail.com>
To: kever.yang@rock-chips.com
Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, lukma@denx.de,
	marex@denx.de, u-boot@lists.denx.de
Subject: [PATCH v1 00/17] Add rk3066 ADC and USB support
Date: Sun,  8 May 2022 17:08:08 +0200	[thread overview]
Message-ID: <20220508150825.21711-1-jbx6244@gmail.com> (raw)

Add rk3066 ADC and USB support.

The Rockchip SoC rk3066 has no support for MMC and USB in the BootROM.
The TPL/SPL parts are mostly stored on NAND. With U-boot stored on
an external media the moment a user wants to start a recovery action
it has to be done in SPL. Some boards only have one ADC switch for the user
and no serial console. The U-boot USB drivers only works in combination
with OF_REAL enabled.

For current ARM SoCs the FDT stored in BBS is erased after SPL relocation
in the crt0.S main function. So for drivers to work in SPL, FDT is move to
the end of DRAM. The global_data must update there pointers.
The common Rockchip functions must also become available in SPL.

Most work has to be done on the ADC driver that has recently had a
"upgrade" for a vref regulator. For Rockchip this regulator are mostly fixed.
As we are in SPL that would introduce 2 extra U-boot classes UCLASS_REGULATOR
and UCLASS_GPIO. In SPL there's no pin control yet, so reduce code and
read these ADC properties from the DT in SPL.
While testing some improvement had to be made for reliability.
Fixup SPL compile and the way the ADC section is shown in U-boot's main menu.

Add a __weak recovery button function as condition to enter the recovery mode
in spl. It then looks for a boot_device to select a storage function method.
And finally run the rockusb gadget while connected to a USB host.

Enable all new futures by adding them to the mk808_defconfig.

Johan Jonker (16):
  rockchip: spl: fix reloc gd and FDT blob pointer
  rockchip: spl: allow more boot devices
  rockchip: spl-boot-order: add usb boot option
  rockchip: board: allow spl compile for usb init functions
  rockchip: usb: gadget: rockusb: enable spl compile
  rockchip: configs: mk808: add spl usb configs
  arm: dts: rockchip: mk808: add adc usb required properties for spl
  rockchip: adc: enable spl compile class driver
  rockchip: adc: reduce error notifications from class driver
  rockchip: adc: enable spl compile rockchip-saradc driver
  rockchip: adc: fix adc timer
  rockchip: adc: fix the hangups
  rockchip: adc: make adc branch compile in SPL
  rockchip: adc: move config items in a sub menu
  rockchip: rk3066: add recovery mode in spl
  rockchip: configs: mk808: enable usb support

Paweł Jarosz (1):
  rockchip: rk3066: config nand data pins in spl

 arch/arm/dts/rk3066a-mk808-u-boot.dtsi        | 29 ++++++
 .../arm/include/asm/arch-rockchip/f_rockusb.h |  1 +
 arch/arm/mach-rockchip/Makefile               |  3 +-
 arch/arm/mach-rockchip/rk3066/rk3066.c        | 93 ++++++++++++++++++-
 arch/arm/mach-rockchip/sdram.c                |  1 +
 arch/arm/mach-rockchip/spl-boot-order.c       |  3 +
 arch/arm/mach-rockchip/spl.c                  | 21 ++++-
 configs/mk808_defconfig                       | 21 ++++-
 drivers/Makefile                              |  3 +-
 drivers/adc/Kconfig                           | 33 +++++++
 drivers/adc/Makefile                          |  4 +-
 drivers/adc/adc-uclass.c                      | 47 +++++++---
 drivers/adc/rockchip-saradc.c                 | 71 ++++++++++----
 drivers/usb/gadget/Kconfig                    | 10 ++
 drivers/usb/gadget/Makefile                   |  2 +-
 include/configs/mk808.h                       |  3 +
 16 files changed, 308 insertions(+), 37 deletions(-)

-- 
2.20.1


             reply	other threads:[~2022-05-08 15:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08 15:08 Johan Jonker [this message]
2022-05-08 15:08 ` [PATCH v1 01/17] rockchip: spl: fix reloc gd and FDT blob pointer Johan Jonker
2022-05-08 15:08 ` [PATCH v1 02/17] rockchip: spl: allow more boot devices Johan Jonker
2022-05-08 15:08 ` [PATCH v1 03/17] rockchip: spl-boot-order: add usb boot option Johan Jonker
2022-05-08 15:08 ` [PATCH v1 04/17] rockchip: board: allow spl compile for usb init functions Johan Jonker
2022-05-08 15:08 ` [PATCH v1 05/17] rockchip: usb: gadget: rockusb: enable spl compile Johan Jonker
2022-05-08 15:08 ` [PATCH v1 06/17] rockchip: configs: mk808: add spl usb configs Johan Jonker
2022-05-08 15:08 ` [PATCH v1 07/17] arm: dts: rockchip: mk808: add adc usb required properties for spl Johan Jonker
2022-05-08 15:08 ` [PATCH v1 08/17] rockchip: adc: enable spl compile class driver Johan Jonker
2022-05-08 15:08 ` [PATCH v1 09/17] rockchip: adc: reduce error notifications from " Johan Jonker
2022-05-08 15:08 ` [PATCH v1 10/17] rockchip: adc: enable spl compile rockchip-saradc driver Johan Jonker
2022-05-08 15:08 ` [PATCH v1 11/17] rockchip: adc: fix adc timer Johan Jonker
2022-05-08 15:08 ` [PATCH v1 12/17] rockchip: adc: fix the hangups Johan Jonker
2022-05-08 15:08 ` [PATCH v1 13/17] rockchip: adc: make adc branch compile in SPL Johan Jonker
2022-05-08 15:08 ` [PATCH v1 14/17] rockchip: adc: move config items in a sub menu Johan Jonker
2022-05-08 15:08 ` [PATCH v1 15/17] rockchip: rk3066: config nand data pins in spl Johan Jonker
2022-05-08 15:08 ` [PATCH v1 16/17] rockchip: rk3066: add recovery mode " Johan Jonker
2022-05-08 15:08 ` [PATCH v1 17/17] rockchip: configs: mk808: enable usb support Johan Jonker

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20220508150825.21711-1-jbx6244@gmail.com \
    --to=jbx6244@gmail.com \
    --cc=kever.yang@rock-chips.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

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

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