[U-Boot] [RFC PATCH 00/11] Add support for 96boards Dragonboard410C board

Mateusz Kulikowski mateusz.kulikowski at gmail.com
Thu Dec 10 22:41:36 CET 2015


Hi All,

With a slight delay (Sorry Syed) I'm finally ready to show code
I've been working recently on.

This series add support for:
- New board - 96board Dragonboard 410C (ARMv8)
- Qualcomm snapdragon architecture (for now only single SoC)
- Some Qualcomm peripherals (UART, GPIO, PMIC including bus, SDHCI, USB...)
- New bus (SPMI)
- It also adds minor function to ehci HCD

Please take a look at it and give me feedback what can be changed so
it will be ready for submission.

I'd like to thank Przemyslaw Marczak for doing initial reviews and
helping me figure out what is the best approach in some cases.

Notes/Design decisions I made/Issues I have/had (please comment them as well)
0) If I missed someone on CC - please let me know;
   If I misused patman - apologize for that - It's my first time with patman.

1) Documentation is missing - dt-bindings, spmi bus documentation.
   I left it as I expect some redesign after your review.

2) I tried to use DM and Kconfig where possible, but some drivers (USB)
   depend on subsystems that don't support Kconfig yet

3) There are 3 long-line warnings and some complains about too short Kconfig
   - is it ok to ignore lines that are 1-2 characters longer (and
   making them shorter will cause code to be less readable)?

4) Licensing (@trini)
   My code is based on 2 trees:
   Linux: https://git.linaro.org/landing-teams/working/qualcomm/kernel.git
   LittleKernel: https://git.linaro.org/people/nicolas.dechesne/lk.git
   One is GPLv2, other BSD(-clause3 I think).
   When tried to figure out how to write drivers, I looked at both drivers,
   and even if some drivers are totally different than their originals,
   they are derivative work.
   I decided to use Linux license where possible (where I was almost sure
   I copied/analyzed Linux drivers), left BSD only for SPMI code.
   Is it ok? Or should I run tool like Protex and drop references where
   code no longer matches linux/lk codebase (not that I have Protex at home)

5) Clock mapping - I need advice on how to properly access clock controller
   from devices that need some clocks to be enabled. I want clock controller
   code to be as simple as possible, but am not sure how to add links to
   a specific clocks.

6) SPMI: I decided to add new bus. Contrary to other vendors, Qualcomm
   SoCs use SPMI to talk with PMICs. This is "closed" bus (you need
   to pay membership to get specification), and I need it to properly
   describe pmics inside device tree.

7) Snapdragon mach: I added new MACH as my plan is to support more than
   one Qualcomm SoC/board - hopefully days where U-Boot had no Qualcomm support
   will be over soon :)

8) I didn't modified Maintainers files - will do that for PATCH v1

9) I moved register offsets to driver files (didn't put them in one big header
   file. I know it's not common but IMO it's better if drivers are
   self contained (and there are not many registers anyways).

10) Compilation causes 8 warnings, none in my code:
  - 1x in asix88179 driver (format %u expects...)
  - 7x in ulpi-viewport code
  The problem is - this drivers are handling poorly ARMv8 processors,
  where sizeof(int) < sizeof(void*) and
  sizeof(int) < sizeof(long).
  Fix for asix would be trivial, with ULPI it's worse as in my opinion
  it needs slight redesign (use phaddr_t or something).
  Is it ok if I redesign that? Or just ignore warnings or write
  my own ulpi code (I wanted to avoid code duplication)

Best Regards,
Mateusz


Mateusz Kulikowski (11):
  serial: Add support for Qualcomm serial port
  gpio: Add support for Qualcomm gpio controller
  mmc: Add support for Qualcomm SDHCI controller
  ehci-hcd: Add init_after_reset
  ehci: Add support for Qualcomm EHCI
  drivers: Add SPMI bus uclass
  drivers: spmi: Add support for Qualcomm SPMI bus driver
  pmic: Add support for Qualcomm PM8916 PMIC
  gpio: Add support for Qualcomm PM8916 gpios
  arm: Add support for Qualcomm Snapdragon family
  board: Add Qualcomm Dragonboard 410C support

 arch/arm/Kconfig                                   |  12 +
 arch/arm/Makefile                                  |   1 +
 arch/arm/dts/Makefile                              |   2 +
 arch/arm/dts/dragonboard410c.dts                   | 157 +++++++++++
 arch/arm/mach-snapdragon/Kconfig                   |  15 +
 arch/arm/mach-snapdragon/Makefile                  |   8 +
 arch/arm/mach-snapdragon/clock-apq8016.c           | 262 ++++++++++++++++++
 arch/arm/mach-snapdragon/include/mach/gpio.h       |  25 ++
 .../mach-snapdragon/include/mach/sysmap-apq8016.h  |  15 +
 arch/arm/mach-snapdragon/reset.c                   |  40 +++
 board/qualcomm/dragonboard410c/Kconfig             |  15 +
 board/qualcomm/dragonboard410c/Makefile            |   8 +
 board/qualcomm/dragonboard410c/dragonboard410c.c   | 111 ++++++++
 board/qualcomm/dragonboard410c/head.S              |  20 ++
 board/qualcomm/dragonboard410c/readme.txt          |  40 +++
 board/qualcomm/dragonboard410c/u-boot.lds          |  90 ++++++
 configs/dragonboard410c_defconfig                  |  29 ++
 drivers/Kconfig                                    |   2 +
 drivers/Makefile                                   |   1 +
 drivers/gpio/Kconfig                               |  14 +
 drivers/gpio/Makefile                              |   3 +-
 drivers/gpio/msm_gpio.c                            | 115 ++++++++
 drivers/gpio/pm8916_gpio.c                         | 306 +++++++++++++++++++++
 drivers/mmc/Kconfig                                |   6 +
 drivers/mmc/Makefile                               |   1 +
 drivers/mmc/msm_sdhci.c                            | 149 ++++++++++
 drivers/power/pmic/Kconfig                         |  14 +
 drivers/power/pmic/Makefile                        |   1 +
 drivers/power/pmic/pm8916.c                        |  92 +++++++
 drivers/serial/Kconfig                             |   5 +
 drivers/serial/Makefile                            |   1 +
 drivers/serial/serial_msm.c                        | 204 ++++++++++++++
 drivers/spmi/Kconfig                               |  16 ++
 drivers/spmi/Makefile                              |   8 +
 drivers/spmi/spmi-msm.c                            | 183 ++++++++++++
 drivers/spmi/spmi-uclass.c                         |  53 ++++
 drivers/usb/host/Kconfig                           |   8 +
 drivers/usb/host/Makefile                          |   1 +
 drivers/usb/host/ehci-hcd.c                        |   6 +
 drivers/usb/host/ehci-msm.c                        | 198 +++++++++++++
 drivers/usb/host/ehci.h                            |   1 +
 include/configs/dragonboard410c.h                  | 184 +++++++++++++
 include/dm/uclass-id.h                             |   1 +
 include/spmi/spmi.h                                |  44 +++
 44 files changed, 2466 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/dragonboard410c.dts
 create mode 100644 arch/arm/mach-snapdragon/Kconfig
 create mode 100644 arch/arm/mach-snapdragon/Makefile
 create mode 100644 arch/arm/mach-snapdragon/clock-apq8016.c
 create mode 100644 arch/arm/mach-snapdragon/include/mach/gpio.h
 create mode 100644 arch/arm/mach-snapdragon/include/mach/sysmap-apq8016.h
 create mode 100644 arch/arm/mach-snapdragon/reset.c
 create mode 100644 board/qualcomm/dragonboard410c/Kconfig
 create mode 100644 board/qualcomm/dragonboard410c/Makefile
 create mode 100644 board/qualcomm/dragonboard410c/dragonboard410c.c
 create mode 100644 board/qualcomm/dragonboard410c/head.S
 create mode 100644 board/qualcomm/dragonboard410c/readme.txt
 create mode 100644 board/qualcomm/dragonboard410c/u-boot.lds
 create mode 100644 configs/dragonboard410c_defconfig
 create mode 100644 drivers/gpio/msm_gpio.c
 create mode 100644 drivers/gpio/pm8916_gpio.c
 create mode 100644 drivers/mmc/msm_sdhci.c
 create mode 100644 drivers/power/pmic/pm8916.c
 create mode 100644 drivers/serial/serial_msm.c
 create mode 100644 drivers/spmi/Kconfig
 create mode 100644 drivers/spmi/Makefile
 create mode 100644 drivers/spmi/spmi-msm.c
 create mode 100644 drivers/spmi/spmi-uclass.c
 create mode 100644 drivers/usb/host/ehci-msm.c
 create mode 100644 include/configs/dragonboard410c.h
 create mode 100644 include/spmi/spmi.h

-- 
2.5.0



More information about the U-Boot mailing list