Skip to contentSkip to conversation

ARM: tegra: cleanup part 1

PATCH New Stephen Warren 5 participants 177 messages Apr 19, 2016 – May 7, 2016 Page 1 of 2

Subsystems (16)
lore
Share & tools
lore
#0 lore raw

cover ARM: tegra: cleanup part 1

From: Stephen Warren <[email protected]>

This series cleans up Tegra code:
- Removes unused definitions.
- Unifies duplicate definitions and code.
- Moves Tegra headers from arch/arm/include to arch/arm/mach-tegra so all Tegra files are located together. Headers for Tegra-specific APIs (intended e.g. for public/driver use) are placed into <mach/>, whereas headers intended only for use by code in arch/arm/mach-tegra are placed into <soc/>.
- Hides as much internal Tegra information as possible, to reduce the size of the "API" provided to Tegra boards. This will help refactoring that "API" later; the next chip is quite different and various parts of this API (e.g. clock, reset, GPIO, ...) will need alternative implementations. This will hopefully be a bit easier after this series.
- Cleans up the set of functions the core Tegra "board" support calls and which are implemented by Tegra board files.
- Replaces funcmux with pinmux functions so that pinmux is set up in as much the same way across all Tegra SoCs as possible.
- Various other cleanup.
- Removes almost 3000 lines!

Future changes/series will likely/hopefully:
- Refactor C files in arch/arm/mach-tegra to allow Makefiles to easily decide which parts to pull in for each chip, and avoid a mess of ifdefs in the C files when adding support for the next chip.
- Convert Tegra to standard clock/reset APIs, since the next chipd will use a different implementation, yet we need them to share the same API so that drivers don't need conditional code.
- Add some new drivers for the next chip.

Stephen Warren (60):
ARM: tegra: remove unused definitions in headers
mmc: tegra: move pad init into MMC driver
mmc: tegra: move header file to driver directory
mmc: tegra: move public header to arch/arm/mach-tegra/include
pwm: tegra: move header file to driver directory
i2c: tegra: move header file to driver directory
usb: tegra: move header file to driver directory
video: tegra: move header file to driver directory
ARM: tegra: correct 64-bit DT unit addresses
ARM: tegra: sort DT /aliases entries
ARM: tegra: add DT alias for GPIO controller
gpio: tegra: remove duplicate define
ARM: tegra: sort some board file include directives
ARM: tegra: use DT bindings for GPIO naming
gpio: tegra: header file split
ARM: tegra: migrate TEGRA_GPIO to Kconfig
ARM: tegra: move apb_misc.h
ARM: tegra: move fuse.h
ARM: tegra: move gpu.h
ARM: tegra: move pmc.h
ARM: tegra: move scu.h
ARM: tegra: move warmboot.h
ARM: tegra: move xusb-padctl.h to <mach/>
ARM: tegra: unify+move {board,sys_proto}.h to <mach/>
ARM: tegra: use consistently named include guards
ARM: tegra: delete unused headers
ARM: tegra: move emc.h
ARM: tegra: move sdram_param.h
ARM: tegra: move sysctr.h
ARM: tegra: remove pmu.h
ARM: tegra: move powergate.h to <mach/>
ARM: tegra: add SoC-specific include directory
ARM: tegra: fix bug in Tegra20 flow.h
ARM: tegra: move flow.h
nyan-big: remove direct MC register access
ARM: tegra: move mc.h
ARM: tegra: move SDIOCFG_DRV* to pinmux.h
ARM: tegra: remove tegra_get_chip()
ARM: tegra: remove get_num_cpus()
ARM: tegra: remove gp_padctrl.h
ARM: tegra: remove tegra_get_sku_info()
ARM: tegra: move EMC code to tegra20/ directory
ARM: tegra: move PLLX configuration into SoC directories
ARM: tegra: remove tegra_get_chip_sku()
ARM: tegra: move custom pinmux.h to <mach/>
ARM: tegra: add pinmux APIs to replace funcmux
ARM: tegra: provide API for SPL code to init UART
ARM: tegra: lay groundwork for board hook cleanup
ARM: tegra: convert boards to new hooks
ARM: tegra: remove unused includes
ARM: tegra: move SPL-specific GPIO device to spl.c
ARM: tegra: convert pin_mux_*() to new hooks
tegra: keyboard: move pinmux setup to board files
video: tegra: move pinmux setup to board files
i2c: tegra: move pinmux setup to board files
ARM: tegra: remove funcmux API
ARM: tegra: don't access Boot Info Table from board code
ARM: tegra: clean up board include statements
ARM: tegra: unify+move tegra.h to mach-tegra/
ARM: tegra: move clock headers

 arch/arm/dts/tegra114.dtsi                         |   4 +
 arch/arm/dts/tegra124-nyan-big.dts                 |  10 +-
 arch/arm/dts/tegra124-nyan.dtsi                    |   4 +-
 arch/arm/dts/tegra20-colibri.dts                   |   2 +-
 arch/arm/dts/tegra20-harmony.dts                   |   4 +-
 arch/arm/dts/tegra20-medcom-wide.dts               |   2 +-
 arch/arm/dts/tegra20-paz00.dts                     |   2 +-
 arch/arm/dts/tegra20-plutux.dts                    |   2 +-
 arch/arm/dts/tegra20-seaboard.dts                  |   4 +-
 arch/arm/dts/tegra20-tec.dts                       |   2 +-
 arch/arm/dts/tegra20-trimslice.dts                 |   4 +-
 arch/arm/dts/tegra20-ventana.dts                   |   2 +-
 arch/arm/dts/tegra20-whistler.dts                  |   2 +-
 arch/arm/dts/tegra20.dtsi                          |   4 +
 arch/arm/dts/tegra210-e2220-1170.dts               |  16 +-
 arch/arm/dts/tegra210-p2371-0000.dts               |  16 +-
 arch/arm/dts/tegra210-p2371-2180.dts               |  20 +-
 arch/arm/dts/tegra210-p2571.dts                    |  48 ++--
 arch/arm/dts/tegra210.dtsi                         |  56 ++--
 arch/arm/dts/tegra30.dtsi                          |   4 +
 arch/arm/include/asm/arch-tegra/ap.h               |  69 -----
 arch/arm/include/asm/arch-tegra/board.h            |  34 ---
 arch/arm/include/asm/arch-tegra/funcmux.h          |  29 --
 arch/arm/include/asm/arch-tegra/gp_padctrl.h       |  26 --
 arch/arm/include/asm/arch-tegra/tegra.h            | 104 -------
 arch/arm/include/asm/arch-tegra/timer.h            |  15 -
 arch/arm/include/asm/arch-tegra/uart.h             |  31 ---
 arch/arm/include/asm/arch-tegra114/funcmux.h       |  21 --
 arch/arm/include/asm/arch-tegra114/gp_padctrl.h    |  73 -----
 arch/arm/include/asm/arch-tegra114/gpio.h          |  20 --
 arch/arm/include/asm/arch-tegra114/pmu.h           |  13 -
 arch/arm/include/asm/arch-tegra114/powergate.h     |   6 -
 arch/arm/include/asm/arch-tegra114/tegra.h         |  25 --
 arch/arm/include/asm/arch-tegra124/ahb.h           |  91 -------
 arch/arm/include/asm/arch-tegra124/display.h       |  58 ----
 arch/arm/include/asm/arch-tegra124/funcmux.h       |  23 --
 arch/arm/include/asm/arch-tegra124/gp_padctrl.h    |  74 -----
 arch/arm/include/asm/arch-tegra124/gpio.h          | 303 ---------------------
 arch/arm/include/asm/arch-tegra124/pmu.h           |  14 -
 arch/arm/include/asm/arch-tegra124/powergate.h     |   6 -
 arch/arm/include/asm/arch-tegra124/pwm.h           |  14 -
 arch/arm/include/asm/arch-tegra124/sysctr.h        |  26 --
 arch/arm/include/asm/arch-tegra124/tegra.h         |  30 --
 arch/arm/include/asm/arch-tegra20/display.h        |  29 --
 arch/arm/include/asm/arch-tegra20/funcmux.h        |  52 ----
 arch/arm/include/asm/arch-tegra20/gpio.h           | 263 ------------------
 arch/arm/include/asm/arch-tegra20/pmu.h            |  14 -
 arch/arm/include/asm/arch-tegra20/powergate.h      |   6 -
 arch/arm/include/asm/arch-tegra20/pwm.h            |  14 -
 arch/arm/include/asm/arch-tegra20/tegra.h          |  22 --
 arch/arm/include/asm/arch-tegra210/ahb.h           |  91 -------
 arch/arm/include/asm/arch-tegra210/funcmux.h       |  23 --
 arch/arm/include/asm/arch-tegra210/gp_padctrl.h    |  74 -----
 arch/arm/include/asm/arch-tegra210/gpio.h          | 303 ---------------------
 arch/arm/include/asm/arch-tegra210/pmu.h           |  14 -
 arch/arm/include/asm/arch-tegra210/powergate.h     |  12 -
 arch/arm/include/asm/arch-tegra210/sysctr.h        |  26 --
 arch/arm/include/asm/arch-tegra210/tegra.h         |  32 ---
 arch/arm/include/asm/arch-tegra30/funcmux.h        |  21 --
 arch/arm/include/asm/arch-tegra30/gp_padctrl.h     |  55 ----
 arch/arm/include/asm/arch-tegra30/gpio.h           | 294 --------------------
 arch/arm/include/asm/arch-tegra30/pmu.h            |  13 -
 arch/arm/include/asm/arch-tegra30/powergate.h      |   6 -
 arch/arm/include/asm/arch-tegra30/tegra.h          |  21 --
 arch/arm/include/asm/gpio.h                        |   2 +-
 arch/arm/mach-tegra/Kconfig                        |   5 +
 arch/arm/mach-tegra/Makefile                       |   5 +-
 arch/arm/mach-tegra/ap.c                           | 117 +-------
 .../asm/arch-tegra => mach-tegra}/apb_misc.h       |   5 +-
 arch/arm/mach-tegra/board.c                        | 138 +---------
 arch/arm/mach-tegra/board2.c                       | 155 +++--------
 arch/arm/mach-tegra/cache.c                        |  24 +-
 arch/arm/mach-tegra/clock.c                        |  12 +-
 arch/arm/mach-tegra/cmd_enterrcm.c                 |   6 +-
 arch/arm/mach-tegra/config.mk                      |  13 +
 arch/arm/mach-tegra/cpu.c                          | 185 ++-----------
 arch/arm/mach-tegra/cpu.h                          |  37 +--
 arch/arm/mach-tegra/emc.c                          |  38 ---
 arch/arm/mach-tegra/gpu.c                          |  11 +-
 .../{include/asm/arch-tegra => mach-tegra}/gpu.h   |   8 +-
 arch/arm/mach-tegra/i2c_early.c                    |  29 ++
 .../include/mach/board.h}                          |  21 +-
 arch/arm/mach-tegra/include/mach/board_init.h      |  15 +
 .../include/mach}/clk_rst.h                        |  89 +-----
 .../include/mach/clock_common.h}                   |  10 +-
 .../include/mach/pinmux_common.h}                  |  11 +-
 .../include/mach}/powergate.h                      |  12 +-
 arch/arm/mach-tegra/include/mach/spl_uart.h        |  20 ++
 .../include/mach/tegra_gpio.h}                     |  18 +-
 arch/arm/mach-tegra/include/mach/tegra_i2c.h       |  25 ++
 .../mmc.h => mach-tegra/include/mach/tegra_mmc.h}  |   7 +-
 .../include/mach}/xusb-padctl.h                    |   4 +-
 arch/arm/mach-tegra/lowlevel_init.S                |   3 +-
 arch/arm/mach-tegra/pinmux-common.c                |   5 +-
 arch/arm/mach-tegra/pllx.h                         |  20 ++
 .../{include/asm/arch-tegra => mach-tegra}/pmc.h   |  25 +-
 arch/arm/mach-tegra/powergate.c                    |   8 +-
 .../{include/asm/arch-tegra => mach-tegra}/scu.h   |   8 +-
 arch/arm/mach-tegra/spl.c                          |  26 +-
 arch/arm/mach-tegra/spl_uart.c                     |  40 +++
 .../asm/arch-tegra114 => mach-tegra}/sysctr.h      |   8 +-
 arch/arm/mach-tegra/tegra.h                        |  76 ++++++
 arch/arm/mach-tegra/tegra114/Makefile              |   5 +-
 arch/arm/mach-tegra/tegra114/clock.c               |  11 +-
 arch/arm/mach-tegra/tegra114/cpu.c                 |  14 +-
 arch/arm/mach-tegra/tegra114/funcmux.c             |  57 ----
 .../tegra114/include/mach}/clock-tables.h          |   8 +-
 .../tegra114/include/mach}/clock.h                 |  10 +-
 .../tegra114/include/mach}/pinmux.h                |  18 +-
 .../tegra114/include/soc}/flow.h                   |   8 +-
 .../tegra114/include/soc}/mc.h                     |   2 +-
 arch/arm/mach-tegra/tegra114/pinmux.c              |  22 +-
 arch/arm/mach-tegra/tegra114/pllx.c                |  33 +++
 arch/arm/mach-tegra/tegra124/Makefile              |   4 +-
 arch/arm/mach-tegra/tegra124/clock.c               |  11 +-
 arch/arm/mach-tegra/tegra124/cpu.c                 |  16 +-
 arch/arm/mach-tegra/tegra124/funcmux.c             |  71 -----
 .../tegra124/include/mach}/clock-tables.h          |   8 +-
 .../tegra124/include/mach}/clock.h                 |  10 +-
 .../tegra124/include/mach}/pinmux.h                |  19 +-
 .../tegra124/include/soc}/flow.h                   |  14 +-
 .../tegra124/include/soc}/mc.h                     |   3 +-
 arch/arm/mach-tegra/tegra124/pinmux.c              |  34 ++-
 arch/arm/mach-tegra/tegra124/pllx.c                |  33 +++
 arch/arm/mach-tegra/tegra124/psci.c                |  10 +-
 arch/arm/mach-tegra/tegra20/Makefile               |   8 +-
 arch/arm/mach-tegra/tegra20/clock.c                |   9 +-
 arch/arm/mach-tegra/tegra20/cpu.c                  |   6 +-
 arch/arm/mach-tegra/tegra20/crypto.h               |   6 +-
 arch/arm/mach-tegra/tegra20/display.c              |  16 --
 arch/arm/mach-tegra/tegra20/emc.c                  |  40 ++-
 arch/arm/mach-tegra/{ => tegra20}/emc.h            |   5 +-
 .../emc.h => mach-tegra/tegra20/emc_priv.h}        |  17 +-
 arch/arm/mach-tegra/tegra20/funcmux.c              | 298 --------------------
 .../asm/arch-tegra => mach-tegra/tegra20}/fuse.h   |   8 +-
 .../tegra20}/gp_padctrl.h                          |  13 +-
 .../tegra20/include/mach}/clock-tables.h           |   8 +-
 .../tegra20/include/mach}/clock.h                  |   5 +-
 .../tegra20/include/mach}/pinmux.h                 |  32 ++-
 .../tegra20/include/soc}/flow.h                    |   7 +-
 .../tegra20/include/soc}/mc.h                      |   2 +-
 arch/arm/mach-tegra/tegra20/pinmux.c               | 211 +++++++++++++-
 arch/arm/mach-tegra/tegra20/pllx.c                 |  56 ++++
 arch/arm/mach-tegra/tegra20/pmu.c                  |  23 +-
 .../tegra20}/sdram_param.h                         |   6 +-
 arch/arm/mach-tegra/tegra20/sku.c                  |  44 +++
 arch/arm/mach-tegra/tegra20/sku.h                  |  12 +
 arch/arm/mach-tegra/tegra20/warmboot.c             |  50 ++--
 .../arch-tegra => mach-tegra/tegra20}/warmboot.h   |   7 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.c         |  21 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.h         |  10 +-
 arch/arm/mach-tegra/tegra210/Makefile              |   4 +-
 arch/arm/mach-tegra/tegra210/clock.c               |  11 +-
 arch/arm/mach-tegra/tegra210/funcmux.c             |  40 ---
 .../tegra210/include/mach}/clock-tables.h          |   8 +-
 .../tegra210/include/mach}/clock.h                 |  11 +-
 .../tegra210/include/mach}/pinmux.h                |  16 +-
 .../tegra210/include/soc}/flow.h                   |  22 +-
 .../tegra210/include/soc}/mc.h                     |   5 +-
 arch/arm/mach-tegra/tegra210/pinmux.c              |   4 +-
 arch/arm/mach-tegra/tegra210/pllx.c                |  33 +++
 arch/arm/mach-tegra/tegra210/xusb-padctl.c         |   9 +-
 arch/arm/mach-tegra/tegra30/Makefile               |   5 +-
 arch/arm/mach-tegra/tegra30/clock.c                |   9 +-
 arch/arm/mach-tegra/tegra30/cpu.c                  |  29 +-
 arch/arm/mach-tegra/tegra30/funcmux.c              |  51 ----
 .../tegra30/include/mach}/clock-tables.h           |   8 +-
 .../tegra30/include/mach}/clock.h                  |  10 +-
 .../tegra30/include/mach}/pinmux.h                 |  18 +-
 .../tegra30/include/soc}/flow.h                    |   8 +-
 .../tegra30/include/soc}/mc.h                      |   2 +-
 arch/arm/mach-tegra/tegra30/pinmux.c               |  16 +-
 arch/arm/mach-tegra/tegra30/pllx.c                 |  34 +++
 arch/arm/mach-tegra/xusb-padctl-common.c           |   6 +-
 arch/arm/mach-tegra/xusb-padctl-common.h           |   9 +-
 arch/arm/mach-tegra/xusb-padctl-dummy.c            |   4 +-
 board/avionic-design/common/tamonten-ng.c          |  53 ++--
 board/avionic-design/common/tamonten.c             |  50 ++--
 board/compal/paz00/paz00.c                         |  41 +--
 board/compulab/trimslice/trimslice.c               |  38 +--
 board/nvidia/cardhu/cardhu.c                       |  47 ++--
 board/nvidia/dalmore/dalmore.c                     |  42 ++-
 board/nvidia/e2220-1170/e2220-1170.c               |  42 ++-
 board/nvidia/e2220-1170/pinmux-config-e2220-1170.h | 122 ++++-----
 board/nvidia/harmony/harmony.c                     |  54 ++--
 board/nvidia/jetson-tk1/jetson-tk1.c               |  29 +-
 board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h | 106 +++----
 board/nvidia/nyan-big/nyan-big.c                   |  48 ++--
 board/nvidia/nyan-big/pinmux-config-nyan-big.h     |  98 +++----
 board/nvidia/p2371-0000/p2371-0000.c               |  42 ++-
 board/nvidia/p2371-0000/pinmux-config-p2371-0000.h | 104 +++----
 board/nvidia/p2371-2180/p2371-2180.c               |  42 ++-
 board/nvidia/p2371-2180/pinmux-config-p2371-2180.h | 126 ++++-----
 board/nvidia/p2571/p2571.c                         |  52 ++--
 board/nvidia/p2571/pinmux-config-p2571.h           |  54 ++--
 board/nvidia/seaboard/seaboard.c                   |  55 ++--
 board/nvidia/venice2/as3722_init.c                 |  21 +-
 board/nvidia/venice2/pinmux-config-venice2.h       | 120 ++++----
 board/nvidia/venice2/venice2.c                     |  22 +-
 board/nvidia/whistler/whistler.c                   |  78 +++---
 board/toradex/apalis_t30/apalis_t30.c              |  32 +--
 board/toradex/colibri_t20/colibri_t20.c            | 144 ++++------
 board/toradex/colibri_t30/colibri_t30.c            |  44 ++-
 drivers/gpio/Kconfig                               |   8 +
 drivers/gpio/tegra_gpio.c                          |  11 +-
 drivers/gpio/tegra_gpio_priv.h                     |  76 ++++++
 drivers/i2c/tegra_i2c.c                            |  34 +--
 .../tegra_i2c.h => drivers/i2c/tegra_i2c_priv.h    |  24 +-
 drivers/input/tegra-kbc.c                          |  10 +-
 drivers/mmc/tegra_mmc.c                            |  43 ++-
 .../tegra_mmc.h => drivers/mmc/tegra_mmc_priv.h    |  13 +-
 drivers/mtd/nand/tegra_nand.c                      |   7 +-
 drivers/pci/pci_tegra.c                            |   9 +-
 drivers/pwm/tegra_pwm.c                            |   5 +-
 .../pwm.h => drivers/pwm/tegra_pwm_priv.h          |   9 +-
 drivers/spi/tegra114_spi.c                         |   6 +-
 drivers/spi/tegra20_sflash.c                       |   8 +-
 drivers/spi/tegra20_slink.c                        |   6 +-
 drivers/spi/tegra210_qspi.c                        |   6 +-
 .../usb.h => drivers/usb/host/ehci-tegra-priv.h    |  11 +-
 drivers/usb/host/ehci-tegra.c                      |   9 +-
 drivers/video/tegra.c                              |  14 +-
 drivers/video/tegra124/display.c                   |   6 +-
 drivers/video/tegra124/dp.c                        |   4 +-
 drivers/video/tegra124/sor.c                       |   6 +-
 .../arch-tegra/dc.h => drivers/video/tegra_dc.h    |  30 +-
 include/configs/apalis_t30.h                       |   7 +-
 include/configs/cardhu.h                           |   6 +-
 include/configs/colibri_t20.h                      |   6 +-
 include/configs/colibri_t30.h                      |   7 +-
 include/configs/dalmore.h                          |   6 +-
 include/configs/e2220-1170.h                       |   5 +-
 include/configs/harmony.h                          |  12 +-
 include/configs/jetson-tk1.h                       |   6 +-
 include/configs/nyan-big.h                         |   6 +-
 include/configs/p2371-0000.h                       |   5 +-
 include/configs/p2371-2180.h                       |   5 +-
 include/configs/p2571.h                            |   6 +-
 include/configs/paz00.h                            |   6 +-
 include/configs/seaboard.h                         |   8 +-
 include/configs/tec-ng.h                           |   5 +-
 include/configs/tec.h                              |   6 +-
 include/configs/tegra-common.h                     |  25 +-
 include/configs/trimslice.h                        |   7 +-
 include/configs/venice2.h                          |   6 +-
 include/configs/whistler.h                         |   7 +-
 246 files changed, 2460 insertions(+), 5400 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra/ap.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/board.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/funcmux.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/gp_padctrl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/tegra.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/timer.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/uart.h
 delete mode 100644 arch/arm/include/asm/arch-tegra114/funcmux.h
 delete mode 100644 arch/arm/include/asm/arch-tegra114/gp_padctrl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra114/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra114/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra114/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra114/tegra.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/ahb.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/display.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/funcmux.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/gp_padctrl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/pwm.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/sysctr.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/tegra.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/display.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/funcmux.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/pwm.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/tegra.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/ahb.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/funcmux.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/gp_padctrl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/sysctr.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/tegra.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/funcmux.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/gp_padctrl.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/tegra.h
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/apb_misc.h (79%)
 create mode 100644 arch/arm/mach-tegra/config.mk
 delete mode 100644 arch/arm/mach-tegra/emc.c
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/gpu.h (80%)
 create mode 100644 arch/arm/mach-tegra/i2c_early.c
 rename arch/arm/{include/asm/arch-tegra/sys_proto.h => mach-tegra/include/mach/board.h} (63%)
 create mode 100644 arch/arm/mach-tegra/include/mach/board_init.h
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/clk_rst.h (85%)
 rename arch/arm/{include/asm/arch-tegra/clock.h => mach-tegra/include/mach/clock_common.h} (98%)
 rename arch/arm/{include/asm/arch-tegra/pinmux.h => mach-tegra/include/mach/pinmux_common.h} (97%)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/powergate.h (81%)
 create mode 100644 arch/arm/mach-tegra/include/mach/spl_uart.h
 rename arch/arm/{include/asm/arch-tegra/gpio.h => mach-tegra/include/mach/tegra_gpio.h} (52%)
 create mode 100644 arch/arm/mach-tegra/include/mach/tegra_i2c.h
 rename arch/arm/{include/asm/arch-tegra/mmc.h => mach-tegra/include/mach/tegra_mmc.h} (50%)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/xusb-padctl.h (92%)
 create mode 100644 arch/arm/mach-tegra/pllx.h
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/pmc.h (96%)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/scu.h (91%)
 create mode 100644 arch/arm/mach-tegra/spl_uart.c
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra}/sysctr.h (81%)
 create mode 100644 arch/arm/mach-tegra/tegra.h
 delete mode 100644 arch/arm/mach-tegra/tegra114/funcmux.c
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra114/include/mach}/clock-tables.h (97%)
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra114/include/mach}/clock.h (61%)
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra114/include/mach}/pinmux.h (95%)
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra114/include/soc}/flow.h (67%)
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra114/include/soc}/mc.h (97%)
 create mode 100644 arch/arm/mach-tegra/tegra114/pllx.c
 delete mode 100644 arch/arm/mach-tegra/tegra124/funcmux.c
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/mach}/clock-tables.h (98%)
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/mach}/clock.h (85%)
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/mach}/pinmux.h (95%)
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/flow.h (82%)
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/mc.h (95%)
 create mode 100644 arch/arm/mach-tegra/tegra124/pllx.c
 delete mode 100644 arch/arm/mach-tegra/tegra20/display.c
 rename arch/arm/mach-tegra/{ => tegra20}/emc.h (62%)
 rename arch/arm/{include/asm/arch-tegra20/emc.h => mach-tegra/tegra20/emc_priv.h} (83%)
 delete mode 100644 arch/arm/mach-tegra/tegra20/funcmux.c
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/tegra20}/fuse.h (83%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20}/gp_padctrl.h (88%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/mach}/clock-tables.h (95%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/mach}/clock.h (77%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/mach}/pinmux.h (81%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/flow.h (71%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/mc.h (97%)
 create mode 100644 arch/arm/mach-tegra/tegra20/pllx.c
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20}/sdram_param.h (96%)
 create mode 100644 arch/arm/mach-tegra/tegra20/sku.c
 create mode 100644 arch/arm/mach-tegra/tegra20/sku.h
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/tegra20}/warmboot.h (95%)
 delete mode 100644 arch/arm/mach-tegra/tegra210/funcmux.c
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/mach}/clock-tables.h (98%)
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/mach}/clock.h (70%)
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/mach}/pinmux.h (96%)
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/flow.h (62%)
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/mc.h (93%)
 create mode 100644 arch/arm/mach-tegra/tegra210/pllx.c
 delete mode 100644 arch/arm/mach-tegra/tegra30/funcmux.c
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra30/include/mach}/clock-tables.h (97%)
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra30/include/mach}/clock.h (58%)
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra30/include/mach}/pinmux.h (96%)
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra30/include/soc}/flow.h (67%)
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra30/include/soc}/mc.h (97%)
 create mode 100644 arch/arm/mach-tegra/tegra30/pllx.c
 create mode 100644 drivers/gpio/tegra_gpio_priv.h
 rename arch/arm/include/asm/arch-tegra/tegra_i2c.h => drivers/i2c/tegra_i2c_priv.h (87%)
 rename arch/arm/include/asm/arch-tegra/tegra_mmc.h => drivers/mmc/tegra_mmc_priv.h (96%)
 rename arch/arm/include/asm/arch-tegra/pwm.h => drivers/pwm/tegra_pwm_priv.h (81%)
 rename arch/arm/include/asm/arch-tegra/usb.h => drivers/usb/host/ehci-tegra-priv.h (97%)
 rename arch/arm/include/asm/arch-tegra/dc.h => drivers/video/tegra_dc.h (94%)
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

From: Stephen Warren <[email protected]>

arch/arm/include/asm/arch-tegra*/*.h have accumulated a fair number of unused definitions. This patch aims to delete them all.

While working on this, I noticed a few redundancies and fixed them. No doubt other redundancies still exist simply because I wasn't looking hard for them.

A few definitions were moved between files to allow deletion of headers.

Later changes will attempt to:
- Reduce the number of headers in the include directory.
- Move headers into arch/arm/mach-tegra/*, or into the same directory as the drivers they serve.
- Eliminate remaining duplication.
- Refactor the headers to allow addition of future SoC support, where those SoCs don't share many of the definitions currently located in common headers.

---
 arch/arm/include/asm/arch-tegra/ap.h         | 69 ---------------------
 arch/arm/include/asm/arch-tegra/clk_rst.h    | 81 +++----------------------
 arch/arm/include/asm/arch-tegra/clock.h      |  2 +-
 arch/arm/include/asm/arch-tegra/gp_padctrl.h |  6 +-
 arch/arm/include/asm/arch-tegra/gpio.h       |  4 +-
 arch/arm/include/asm/arch-tegra/pmc.h        | 19 +-----
 arch/arm/include/asm/arch-tegra/pwm.h        |  3 +-
 arch/arm/include/asm/arch-tegra/sys_proto.h  |  4 +-
 arch/arm/include/asm/arch-tegra/tegra.h      | 26 ++------
 arch/arm/include/asm/arch-tegra/tegra_i2c.h  | 11 +---
 arch/arm/include/asm/arch-tegra/tegra_mmc.h  |  4 +-
 arch/arm/include/asm/arch-tegra/timer.h      | 15 -----
 arch/arm/include/asm/arch-tegra/uart.h       | 31 ----------
 arch/arm/include/asm/arch-tegra/usb.h        |  5 +-
 arch/arm/include/asm/arch-tegra/warmboot.h   |  3 +-
 arch/arm/include/asm/arch-tegra124/ahb.h     | 91 ----------------------------
 arch/arm/include/asm/arch-tegra124/display.h | 58 ------------------
 arch/arm/include/asm/arch-tegra124/flow.h    |  8 +--
 arch/arm/include/asm/arch-tegra124/mc.h      |  3 +-
 arch/arm/include/asm/arch-tegra124/tegra.h   |  5 +-
 arch/arm/include/asm/arch-tegra20/tegra.h    |  4 +-
 arch/arm/include/asm/arch-tegra210/ahb.h     | 13 +---
 arch/arm/include/asm/arch-tegra210/clock.h   |  3 +-
 arch/arm/include/asm/arch-tegra210/flow.h    | 16 +----
 arch/arm/include/asm/arch-tegra210/mc.h      |  5 +-
 arch/arm/include/asm/arch-tegra210/tegra.h   |  5 +-
 arch/arm/include/asm/arch-tegra30/tegra.h    |  4 +-
 arch/arm/mach-tegra/ap.c                     | 10 +--
 arch/arm/mach-tegra/board.c                  | 11 ++--
 arch/arm/mach-tegra/board2.c                 |  6 +-
 arch/arm/mach-tegra/cache.c                  |  4 +-
 arch/arm/mach-tegra/clock.c                  |  4 +-
 arch/arm/mach-tegra/cpu.h                    | 34 +++++++----
 arch/arm/mach-tegra/emc.c                    |  5 +-
 arch/arm/mach-tegra/tegra114/clock.c         |  3 +-
 arch/arm/mach-tegra/tegra124/clock.c         |  3 +-
 arch/arm/mach-tegra/tegra124/cpu.c           |  4 +-
 arch/arm/mach-tegra/tegra124/psci.c          |  3 +-
 arch/arm/mach-tegra/tegra20/clock.c          |  3 +-
 arch/arm/mach-tegra/tegra20/display.c        |  5 +-
 arch/arm/mach-tegra/tegra20/emc.c            |  2 +-
 arch/arm/mach-tegra/tegra20/pmu.c            |  4 +-
 arch/arm/mach-tegra/tegra20/warmboot.c       |  4 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.c   |  6 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.h   |  6 +-
 arch/arm/mach-tegra/tegra210/clock.c         |  3 +-
 arch/arm/mach-tegra/tegra30/clock.c          |  3 +-
 board/avionic-design/common/tamonten.c       |  9 ++-
 board/toradex/apalis_t30/apalis_t30.c        |  6 +-
 board/toradex/colibri_t20/colibri_t20.c      |  4 +-
 board/toradex/colibri_t30/colibri_t30.c      |  6 +-
 drivers/i2c/tegra_i2c.c                      |  6 +-
 drivers/input/tegra-kbc.c                    |  5 +-
 drivers/video/tegra.c                        |  3 +-
 include/configs/tegra-common.h               | 10 ++-
 55 files changed, 117 insertions(+), 553 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra/ap.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/timer.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/uart.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/ahb.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/display.h
arch/arm/include/asm/arch-tegra/ap.h deleted +0 -69
deleted file mode 100644
index 8c2586c6f548..000000000000
@@ -1,69 +0,0 @@
-/*
- * (C) Copyright 2010-2015
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-#include <asm/types.h>
-
-/* Stabilization delays, in usec */
-#define PLL_STABILIZATION_DELAY	(300)
-#define IO_STABILIZATION_DELAY	(1000)
-
-#define PLLX_ENABLED		(1 << 30)
-#define CCLK_BURST_POLICY	0x20008888
-#define SUPER_CCLK_DIVIDER	0x80000000
-
-/* Calculate clock fractional divider value from ref and target frequencies */
-#define CLK_DIVIDER(REF, FREQ)	((((REF) * 2) / FREQ) - 2)
-
-/* Calculate clock frequency value from reference and clock divider value */
-#define CLK_FREQUENCY(REF, REG)	(((REF) * 2) / (REG + 2))
-
-/* AVP/CPU ID */
-#define PG_UP_TAG_0_PID_CPU	0x55555555	/* CPU aka "a9" aka "mpcore" */
-#define PG_UP_TAG_0		0x0
-
-/* AP base physical address of internal SRAM */
-#define NV_PA_BASE_SRAM		0x40000000
-
-#define EXCEP_VECTOR_CPU_RESET_VECTOR	(NV_PA_EVP_BASE + 0x100)
-#define CSITE_CPU_DBG0_LAR		(NV_PA_CSITE_BASE + 0x10FB0)
-#define CSITE_CPU_DBG1_LAR		(NV_PA_CSITE_BASE + 0x12FB0)
-
-#define FLOW_CTLR_HALT_COP_EVENTS	(NV_PA_FLOW_BASE + 4)
-#define FLOW_MODE_STOP			2
-#define HALT_COP_EVENT_JTAG		(1 << 28)
-#define HALT_COP_EVENT_IRQ_1		(1 << 11)
-#define HALT_COP_EVENT_FIQ_1		(1 << 9)
-
-/* This is the main entry into U-Boot, used by the Cortex-A9 */
-extern void _start(void);
-
-/**
- * Works out the SOC/SKU type used for clocks settings
- *
- * @return	SOC type - see TEGRA_SOC...
- */
-int tegra_get_chip_sku(void);
-
-/**
- * Returns the pure SOC (chip ID) from the HIDREV register
- *
- * @return	SOC ID - see CHIPID_TEGRAxx...
- */
-int tegra_get_chip(void);
-
-/**
- * Returns the SKU ID from the sku_info register
- *
- * @return	SKU ID - see SKU_ID_Txx...
- */
-int tegra_get_sku_info(void);
-
-/* Do any chip-specific cache config */
-void config_cache(void);
-
-#if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
-bool tegra_cpu_is_non_secure(void);
-#endif
arch/arm/include/asm/arch-tegra/clk_rst.h +8 -73

135 lines not on this page · raw message

arch/arm/include/asm/arch-tegra/clock.h +1 -1
index e56031d1afa7..a20832b7f35f 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -134,7 +135,6 @@ enum crc_reset_id {
 	/* Things we can hold in reset for each CPU */
 	crc_rst_cpu = 1,
 	crc_rst_de = 1 << 4,	/* What is de? */
-	crc_rst_watchdog = 1 << 8,
 	crc_rst_debug = 1 << 12,
 };
 
arch/arm/include/asm/arch-tegra/gp_padctrl.h +2 -4
index 695f3e6fba82..854966a30f9e 100644
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -8,8 +8,6 @@
 #ifndef _TEGRA_GP_PADCTRL_H_
 #define _TEGRA_GP_PADCTRL_H_
 
-#define GP_HIDREV			0x804
-
 /* bit fields definitions for APB_MISC_GP_HIDREV register */
 #define HIDREV_CHIPID_SHIFT		8
 #define HIDREV_CHIPID_MASK		(0xff << HIDREV_CHIPID_SHIFT)
arch/arm/include/asm/arch-tegra/gpio.h +2 -2
index daf5698e6625..363d16c486d1 100644
@@ -1,5 +1,7 @@
 /*
  * Copyright (c) 2011, Google Inc. All rights reserved.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
+ *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
@@ -8,8 +10,6 @@
 
 #define TEGRA_GPIOS_PER_PORT	8
 #define TEGRA_PORTS_PER_BANK	4
-#define MAX_NUM_GPIOS           (TEGRA_GPIO_PORTS * TEGRA_GPIO_BANKS * 8)
-#define GPIO_NAME_SIZE		20	/* gpio_request max label len */
 
 #define GPIO_BANK(x)		((x) >> 5)
 #define GPIO_PORT(x)		(((x) >> 3) & 0x3)
arch/arm/include/asm/arch-tegra/pmc.h +2 -17
index 66c08797656c..9c9b67448985 100644
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -294,7 +294,6 @@ struct pmc_ctlr {
 #define CRAIL		0
 #define CE0		14
 #define C0NC		15
-#define SOR		17
 
 #define PMC_XOFS_SHIFT	1
 #define PMC_XOFS_MASK	(0x3F << PMC_XOFS_SHIFT)
@@ -319,20 +318,6 @@ struct pmc_ctlr {
 #define MULT_16			4
 #endif
 
-#define AMAP_WRITE_SHIFT	20
-#define AMAP_WRITE_ON		(1 << AMAP_WRITE_SHIFT)
-
-/* SEC_DISABLE_0, 0x04 */
-#define SEC_DISABLE_WRITE0_ON			(1 << 4)
-#define SEC_DISABLE_READ0_ON			(1 << 5)
-#define SEC_DISABLE_WRITE1_ON			(1 << 6)
-#define SEC_DISABLE_READ1_ON			(1 << 7)
-#define SEC_DISABLE_WRITE2_ON			(1 << 8)
-#define SEC_DISABLE_READ2_ON			(1 << 9)
-#define SEC_DISABLE_WRITE3_ON			(1 << 10)
-#define SEC_DISABLE_READ3_ON			(1 << 11)
-#define SEC_DISABLE_AMAP_WRITE_ON		(1 << 20)
-
 /* APBDEV_PMC_PWRGATE_TOGGLE_0 0x30 */
 #define PWRGATE_TOGGLE_PARTID_CRAIL		0
 #define PWRGATE_TOGGLE_PARTID_TD		1
arch/arm/include/asm/arch-tegra/pwm.h +1 -2
index 5a2d9f3a9c1e..b69c0b041f40 100644
@@ -2,6 +2,7 @@
  * Tegra pulse width frequency modulator definitions
  *
  * Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -15,8 +16,6 @@ struct pwm_ctlr {
 	uint reserved[3];	/* Space space */
 };
 
-#define PWM_NUM_CHANNELS	4
-
 /* PWM_CONTROLLER_PWM_CSR_0/1/2/3_0 */
 #define PWM_ENABLE_SHIFT	31
 #define PWM_ENABLE_MASK	(0x1 << PWM_ENABLE_SHIFT)
arch/arm/include/asm/arch-tegra/sys_proto.h +1 -3
index b64f9d813b0e..8c2f94b578fe 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010,2011
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -8,8 +8,6 @@
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
 
-void invalidate_dcache(void);
-
 /**
  * tegra_board_id() - Get the board iD
  *
arch/arm/include/asm/arch-tegra/tegra.h +5 -21
index 3add1b3c09bb..4051a7d26630 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2015
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -8,6 +8,8 @@
 #ifndef _TEGRA_H_
 #define _TEGRA_H_
 
+/* AP base physical address of internal SRAM */
+#define NV_PA_BASE_SRAM		0x40000000
 #define NV_PA_ARM_PERIPHBASE	0x50040000
 #define NV_PA_PG_UP_BASE	0x60000000
 #define NV_PA_TMRUS_BASE	0x60005010
@@ -22,17 +24,8 @@
 #define NV_PA_APB_UARTC_BASE	(NV_PA_APB_MISC_BASE + 0x6200)
 #define NV_PA_APB_UARTD_BASE	(NV_PA_APB_MISC_BASE + 0x6300)
 #define NV_PA_APB_UARTE_BASE	(NV_PA_APB_MISC_BASE + 0x6400)
-#define NV_PA_NAND_BASE		(NV_PA_APB_MISC_BASE + 0x8000)
-#define NV_PA_SPI_BASE		(NV_PA_APB_MISC_BASE + 0xC380)
-#define NV_PA_SLINK1_BASE	(NV_PA_APB_MISC_BASE + 0xD400)
-#define NV_PA_SLINK2_BASE	(NV_PA_APB_MISC_BASE + 0xD600)
-#define NV_PA_SLINK3_BASE	(NV_PA_APB_MISC_BASE + 0xD800)
-#define NV_PA_SLINK4_BASE	(NV_PA_APB_MISC_BASE + 0xDA00)
-#define NV_PA_SLINK5_BASE	(NV_PA_APB_MISC_BASE + 0xDC00)
-#define NV_PA_SLINK6_BASE	(NV_PA_APB_MISC_BASE + 0xDE00)
 #define TEGRA_DVC_BASE		(NV_PA_APB_MISC_BASE + 0xD000)
 #define NV_PA_PMC_BASE		(NV_PA_APB_MISC_BASE + 0xE400)
-#define NV_PA_EMC_BASE		(NV_PA_APB_MISC_BASE + 0xF400)
 #define NV_PA_FUSE_BASE		(NV_PA_APB_MISC_BASE + 0xF800)
 #if defined(CONFIG_TEGRA20) || defined(CONFIG_TEGRA30) || \
 	defined(CONFIG_TEGRA114)
@@ -40,19 +33,11 @@
 #else
 #define NV_PA_CSITE_BASE	0x70800000
 #endif
-#define TEGRA_USB_ADDR_MASK	0xFFFFC000
 
-#define NV_PA_SDRC_CS0		NV_PA_SDRAM_BASE
-#define LOW_LEVEL_SRAM_STACK	0x4000FFFC
-#define EARLY_AVP_STACK		(NV_PA_SDRAM_BASE + 0x20000)
-#define EARLY_CPU_STACK		(EARLY_AVP_STACK - 4096)
+#define PG_UP_TAG_0		0x0
 #define PG_UP_TAG_AVP		0xAAAAAAAA
 
 #ifndef __ASSEMBLY__
-struct timerus {
-	unsigned int cntr_1us;
-};
-
 /* Address at which WB code runs, it must not overlap Bootrom's IRAM usage */
 #define NV_WB_RUN_ADDRESS	0x40020000
 
@@ -96,9 +81,8 @@ enum {
 	TEGRA_SOC_CNT,
 	TEGRA_SOC_UNKNOWN	= -1,
 };
+#endif
 
-#else  /* __ASSEMBLY__ */
 #define PRM_RSTCTRL		NV_PA_PMC_BASE
-#endif
 
 #endif	/* TEGRA_H */
arch/arm/include/asm/arch-tegra/tegra_i2c.h +2 -9
index 341df74d777d..eb83af89f7f5 100644
@@ -1,7 +1,7 @@
 /*
  * NVIDIA Tegra I2C controller
  *
- * Copyright 2010-2011 NVIDIA Corporation
+ * Copyright 2010-2016 NVIDIA Corporation
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -18,11 +18,7 @@ enum {
 
 enum i2c_transaction_flags {
 	I2C_IS_WRITE = 0x1,		/* for I2C write operation */
-	I2C_IS_10_BIT_ADDRESS = 0x2,	/* for 10-bit I2C slave address */
-	I2C_USE_REPEATED_START = 0x4,	/* for repeat start */
-	I2C_NO_ACK = 0x8,		/* for slave that won't generate ACK */
-	I2C_SOFTWARE_CONTROLLER	= 0x10,	/* for I2C transfer using GPIO */
-	I2C_NO_STOP = 0x20,
+	I2C_USE_REPEATED_START = 0x2,	/* for repeat start */
 };
 
 /* Contians the I2C transaction details */
@@ -38,7 +34,6 @@ struct i2c_trans_info {
 	 * the slave device.
 	 */
 	u8 *buf;
-	int is_10bit_address;
 };
 
 struct i2c_control {
@@ -142,8 +137,6 @@ struct i2c_ctlr {
 #define I2C_INT_ARBITRATION_LOST_MASK	(1 << I2C_INT_ARBITRATION_LOST_SHIFT)
 
 /* I2C_CLK_DIVISOR_REGISTER */
-#define CLK_DIV_STD_FAST_MODE		0x19
-#define CLK_DIV_HS_MODE			1
 #define CLK_MULT_STD_FAST_MODE		8
 
 /**
arch/arm/include/asm/arch-tegra/tegra_mmc.h +1 -3
index a20bdaa61872..9b371add1de4 100644
@@ -1,7 +1,7 @@
 /*
+ * Copyright (C) 2011-2016 NVIDIA Corporation
  * (C) Copyright 2009 SAMSUNG Electronics
  * Minkyu Kang <[email protected]>
- * Portions Copyright (C) 2011-2012 NVIDIA Corporation
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -15,7 +15,6 @@
 /* for mmc_config definition */
 #include <mmc.h>
 
-#ifndef __ASSEMBLY__
 struct tegra_mmc {
 	unsigned int	sysad;		/* _SYSTEM_ADDRESS_0 */
 	unsigned short	blksize;	/* _BLOCK_SIZE_BLOCK_COUNT_0 15:00 */
@@ -145,5 +144,4 @@ struct mmc_host {
 
 void pad_init_mmc(struct mmc_host *host);
 
-#endif	/* __ASSEMBLY__ */
 #endif	/* __TEGRA_MMC_H_ */
arch/arm/include/asm/arch-tegra/timer.h deleted +0 -15
deleted file mode 100644
index 5d5664115f41..000000000000
@@ -1,15 +0,0 @@
-/*
- * Copyright (c) 2011 The Chromium OS Authors.
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-/* Tegra20 timer functions */
-
-#ifndef _TEGRA_TIMER_H
-#define _TEGRA_TIMER_H
-
-/* returns the current monotonic timer value in microseconds */
-unsigned long timer_get_us(void);
-
-#endif
arch/arm/include/asm/arch-tegra/uart.h deleted +0 -31
deleted file mode 100644
index fef7f8db3f98..000000000000
@@ -1,31 +0,0 @@
-/*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef _UART_H_
-#define _UART_H_
-
-/* UART registers */
-struct uart_ctlr {
-	uint uart_thr_dlab_0;		/* UART_THR_DLAB_0_0, offset 00 */
-	uint uart_ier_dlab_0;		/* UART_IER_DLAB_0_0, offset 04 */
-	uint uart_iir_fcr;		/* UART_IIR_FCR_0, offset 08 */
-	uint uart_lcr;			/* UART_LCR_0, offset 0C */
-	uint uart_mcr;			/* UART_MCR_0, offset 10 */
-	uint uart_lsr;			/* UART_LSR_0, offset 14 */
-	uint uart_msr;			/* UART_MSR_0, offset 18 */
-	uint uart_spr;			/* UART_SPR_0, offset 1C */
-	uint uart_irda_csr;		/* UART_IRDA_CSR_0, offset 20 */
-	uint uart_reserved[6];		/* Reserved, unused, offset 24-38*/
-	uint uart_asr;			/* UART_ASR_0, offset 3C */
-};
-
-#define NVRM_PLLP_FIXED_FREQ_KHZ	216000
-#define NV_DEFAULT_DEBUG_BAUD		115200
-
-#define UART_FCR_TRIGGER_3	0x30	/* Mask for trigger set at 3 */
-
-#endif	/* UART_H */
arch/arm/include/asm/arch-tegra/usb.h +1 -4
index f400c01a3954..24198e4a33d0 100644
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * Copyright (c) 2013 NVIDIA Corporation
+ * Copyright (c) 2013-2016 NVIDIA Corporation
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -355,7 +355,4 @@ struct usb_ctlr {
 #define VBUS_B_SESS_VLD_SW_VALUE	(1 << 12)
 #define VBUS_B_SESS_VLD_SW_EN		(1 << 11)
 
-/* Setup USB on the board */
-int usb_process_devicetree(const void *blob);
-
 #endif	/* _TEGRA_USB_H_ */
arch/arm/include/asm/arch-tegra/warmboot.h +1 -2
index 2e66e0f23b9b..b6326c8f7b11 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010, 2011
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -127,7 +127,6 @@ union scratch3_reg {
 int warmboot_save_sdram_params(void);
 
 int warmboot_prepare_code(u32 seg_address, u32 seg_length);
-int sign_data_block(u8 *source, u32 length, u8 *signature);
 void wb_start(void);	/* Start of WB assembly code */
 void wb_end(void);	/* End of WB assembly code */
 
arch/arm/include/asm/arch-tegra124/ahb.h deleted +0 -91

91 lines not on this page · raw message

arch/arm/include/asm/arch-tegra124/display.h deleted +0 -58

58 lines not on this page · raw message

arch/arm/include/asm/arch-tegra124/flow.h +1 -7
index 7818b1bd3455..3f70fb190527 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2013
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -35,14 +35,8 @@ struct flow_ctlr {
 };
 
 /* HALT_COP_EVENTS_0, 0x04 */
-#define EVENT_MSEC		(1 << 24)
-#define EVENT_USEC		(1 << 25)
-#define EVENT_JTAG		(1 << 28)
 #define EVENT_MODE_STOP		(2 << 29)
 
-/* FLOW_CTLR_CLUSTER_CONTROL_0 0x2c */
-#define ACTIVE_LP		(1 << 0)
-
 /* CPUn_CSR_0 */
 #define CSR_ENABLE		(1 << 0)
 #define CSR_IMMEDIATE_WAKE	(1 << 3)
arch/arm/include/asm/arch-tegra124/mc.h +1 -2
index d97b2c87c631..190dd9754ef1 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -66,7 +66,6 @@ struct mc_ctlr {
 
 #define TEGRA_MC_SMMU_CONFIG_ENABLE (1 << 0)
 
-#define TEGRA_MC_VIDEO_PROTECT_REG_WRITE_ACCESS_ENABLED		(0 << 0)
 #define TEGRA_MC_VIDEO_PROTECT_REG_WRITE_ACCESS_DISABLED	(1 << 0)
 
 #endif	/* _TEGRA124_MC_H_ */
arch/arm/include/asm/arch-tegra124/tegra.h +1 -4
index db3d8379203b..f009925611c6 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -23,8 +23,5 @@
 #define NVBOOTINFOTABLE_BCTPTR	0x4C	/* BCT pointer in BIT in IRAM */
 
 #define MAX_NUM_CPU		4
-#define MCB_EMEM_ARB_OVERRIDE	(NV_PA_MC_BASE + 0xE8)
-
-#define TEGRA_USB1_BASE		0x7D000000
 
 #endif /* _TEGRA124_H_ */
arch/arm/include/asm/arch-tegra20/tegra.h +1 -3
index 22774abb936d..1cea245e4171 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010,2011
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -13,8 +13,6 @@
 
 #include <asm/arch-tegra/tegra.h>
 
-#define TEGRA_USB1_BASE		0xC5000000
-
 #define BCT_ODMDATA_OFFSET	4068	/* 12 bytes from end of BCT */
 
 #define MAX_NUM_CPU		2
arch/arm/include/asm/arch-tegra210/ahb.h +1 -12
index 3a37af417748..2e676a436e3d 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2015
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -77,15 +77,4 @@ struct ahb_ctlr {
 	u32 axicif_fastsync2_mcclk_to_cpuclk;
 };
 
-#define PPSB_STOPCLK_ENABLE	(1 << 2)
-
-#define GIZ_ENABLE_SPLIT	(1 << 0)
-#define GIZ_ENB_FAST_REARB	(1 << 2)
-#define GIZ_DONT_SPLIT_AHB_WR	(1 << 7)
-
-#define GIZ_USB_IMMEDIATE	(1 << 18)
-
-/* AHB_ARBITRATION_XBAR_CTRL_0 0xe0 */
-#define ARBITRATION_XBAR_CTRL_PPSB_ENABLE	(1 << 2)
-
 #endif	/* _TEGRA210_AHB_H_ */
arch/arm/include/asm/arch-tegra210/clock.h +1 -2
index 3501be2abbb4..54e70439952d 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2015
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -20,7 +20,6 @@
 #define PLLC_RESET		30
 #define PLLC_IDDQ		27
 #define PLLD_ENABLE_CLK		21
-#define PLLD_EN_LCKDET		28
 
 int tegra_plle_enable(void);
 
arch/arm/include/asm/arch-tegra210/flow.h +1 -15
index e2301aee548f..e4ede6a81500 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2015
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -28,18 +28,4 @@ struct flow_ctlr {
 	u32 ram_repair;		/* offset 0x40 */
 };
 
-/* HALT_COP_EVENTS_0, 0x04 */
-#define EVENT_MSEC		(1 << 24)
-#define EVENT_USEC		(1 << 25)
-#define EVENT_JTAG		(1 << 28)
-#define EVENT_MODE_STOP		(2 << 29)
-
-/* FLOW_CTLR_CLUSTER_CONTROL_0 0x2c */
-#define ACTIVE_LP		(1 << 0)
-
-/* CPUn_CSR_0 */
-#define CSR_ENABLE		(1 << 0)
-#define CSR_IMMEDIATE_WAKE	(1 << 3)
-#define CSR_WAIT_WFI_SHIFT	8
-
 #endif /*  _TEGRA210_FLOW_H_ */
arch/arm/include/asm/arch-tegra210/mc.h +1 -4
index 77e9aa51f60f..dc910b9c7a0f 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2016 NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier: GPL-2.0+
  */
@@ -64,9 +64,6 @@ struct mc_ctlr {
 	u32 mc_video_protect_reg_ctrl;		/* offset 0x650 */
 };
 
-#define TEGRA_MC_SMMU_CONFIG_ENABLE (1 << 0)
-
-#define TEGRA_MC_VIDEO_PROTECT_REG_WRITE_ACCESS_ENABLED		(0 << 0)
 #define TEGRA_MC_VIDEO_PROTECT_REG_WRITE_ACCESS_DISABLED	(1 << 0)
 
 #endif	/* _TEGRA210_MC_H_ */
arch/arm/include/asm/arch-tegra210/tegra.h +1 -4
index 95c67fbb8e9f..17b9f6af3679 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2015
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -25,8 +25,5 @@
 #define NVBOOTINFOTABLE_BCTPTR	0x4C	/* BCT pointer in BIT in IRAM */
 
 #define MAX_NUM_CPU		4
-#define MCB_EMEM_ARB_OVERRIDE	(NV_PA_MC_BASE + 0xE8)
-
-#define TEGRA_USB1_BASE		0x7D000000
 
 #endif /* _TEGRA210_TEGRA_H_ */
arch/arm/include/asm/arch-tegra30/tegra.h +1 -3
index 280245e98e87..28f9741a1d76 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -12,8 +12,6 @@
 
 #include <asm/arch-tegra/tegra.h>
 
-#define TEGRA_USB1_BASE		0x7D000000
-
 #define BCT_ODMDATA_OFFSET	6116	/* 12 bytes from end of BCT */
 
 #define MAX_NUM_CPU		4
arch/arm/mach-tegra/ap.c +5 -5
index a4fa00c9adae..336a7e08196d 100644
@@ -1,9 +1,9 @@
 /*
-* (C) Copyright 2010-2015
-* NVIDIA Corporation <www.nvidia.com>
-*
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
+ *
  * SPDX-License-Identifier:	GPL-2.0+
-*/
+ */
 
 /* Tegra AP (Application Processor) code */
 
@@ -12,13 +12,13 @@
 #include <asm/io.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/mc.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/clock.h>
 #include <asm/arch-tegra/fuse.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/scu.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/arch-tegra/warmboot.h>
+#include "cpu.h"
 
 int tegra_get_chip(void)
 {
arch/arm/mach-tegra/board.c +5 -6
index 3d1d26d13d13..098547ab1e88 100644
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -14,7 +14,6 @@
 #include <asm/arch/funcmux.h>
 #include <asm/arch/mc.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/sys_proto.h>
@@ -77,7 +76,7 @@ static phys_size_t query_sdram_size(void)
 	emem_cfg = readl(&mc->mc_emem_cfg);
 #if defined(CONFIG_TEGRA20)
 	debug("mc->mc_emem_cfg (MEM_SIZE_KB) = 0x%08x\n", emem_cfg);
-	size_bytes = get_ram_size((void *)PHYS_SDRAM_1, emem_cfg * 1024);
+	size_bytes = get_ram_size((void *)NV_PA_SDRAM_BASE, emem_cfg * 1024);
 #else
 	debug("mc->mc_emem_cfg (MEM_SIZE_MB) = 0x%08x\n", emem_cfg);
 #ifndef CONFIG_PHYS_64BIT
@@ -101,8 +100,8 @@ static phys_size_t query_sdram_size(void)
 		 * avoid using it. There's no reason we should need this
 		 * validation step anyway.
 		 */
-		if (emem_cfg <= (0 - PHYS_SDRAM_1) / (1024 * 1024))
-			size_bytes = get_ram_size((void *)PHYS_SDRAM_1,
+		if (emem_cfg <= (0 - NV_PA_SDRAM_BASE) / (1024 * 1024))
+			size_bytes = get_ram_size((void *)NV_PA_SDRAM_BASE,
 						  size_bytes);
 #endif
 	}
arch/arm/mach-tegra/board2.c +2 -4
index 141d6e1cb555..33e346017a8b 100644
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -17,12 +17,10 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/sys_proto.h>
-#include <asm/arch-tegra/uart.h>
 #include <asm/arch-tegra/warmboot.h>
 #include <asm/arch-tegra/gpu.h>
 #ifdef CONFIG_TEGRA_CLOCK_SCALING
arch/arm/mach-tegra/cache.c +2 -2
index 6dad40325d2f..b93814fcb96b 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2013-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -8,8 +8,8 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch/gp_padctrl.h>
+#include "cpu.h"
 
 #ifndef CONFIG_ARM64
 void config_cache(void)
arch/arm/mach-tegra/clock.c +1 -3
index c50d56dc888b..80d6fccf2551 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2015, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -11,10 +11,8 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
-#include <asm/arch-tegra/timer.h>
 #include <div64.h>
 #include <fdtdec.h>
 
arch/arm/mach-tegra/cpu.h +21 -13
index 3f38969a44f1..c0284ce03787 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2015
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -21,20 +21,12 @@
 #error "Unknown Tegra chip!"
 #endif
 
-#define PLLX_ENABLED		(1 << 30)
 #define CCLK_BURST_POLICY	0x20008888
 #define SUPER_CCLK_DIVIDER	0x80000000
 
 /* Calculate clock fractional divider value from ref and target frequencies */
 #define CLK_DIVIDER(REF, FREQ)  ((((REF) * 2) / FREQ) - 2)
 
-/* Calculate clock frequency value from reference and clock divider value */
-#define CLK_FREQUENCY(REF, REG)  (((REF) * 2) / (REG + 2))
-
-/* AVP/CPU ID */
-#define PG_UP_TAG_0_PID_CPU	0x55555555	/* CPU aka "a9" aka "mpcore" */
-#define PG_UP_TAG_0             0x0
-
 #define CORESIGHT_UNLOCK	0xC5ACCE55
 
 #define EXCEP_VECTOR_CPU_RESET_VECTOR	(NV_PA_EVP_BASE + 0x100)
@@ -53,10 +45,6 @@
 
 #define SIMPLE_PLLX     (CLOCK_ID_XCPU - CLOCK_ID_FIRST_SIMPLE)
 
-/* SB_AA64_RESET_LOW and _HIGH defines for CPU reset vector */
-#define SB_AA64_RESET_LOW	0x6000C230
-#define SB_AA64_RESET_HIGH	0x6000C234
-
 struct clk_pll_table {
 	u16	n;
 	u16	m;
@@ -71,8 +59,28 @@ void init_pllx(void);
 void powerup_cpu(void);
 void reset_A9_cpu(int reset);
 void start_cpu(u32 reset_vector);
+/**
+ * Returns the pure SOC (chip ID) from the HIDREV register
+ *
+ * @return	SOC ID - see CHIPID_TEGRAxx...
+ */
 int tegra_get_chip(void);
+/**
+ * Returns the SKU ID from the sku_info register
+ *
+ * @return	SKU ID - see SKU_ID_Txx...
+ */
 int tegra_get_sku_info(void);
+/**
+ * Works out the SOC/SKU type used for clocks settings
+ *
+ * @return	SOC type - see TEGRA_SOC...
+ */
 int tegra_get_chip_sku(void);
 void adjust_pllp_out_freqs(void);
 void pmic_enable_cpu_vdd(void);
+/* Do any chip-specific cache config */
+void config_cache(void);
+#if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
+bool tegra_cpu_is_non_secure(void);
+#endif
arch/arm/mach-tegra/emc.c +3 -2
index 8c62f36a7b04..70aec7fc1b3d 100644
@@ -1,19 +1,20 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
 #include <common.h>
-#include "emc.h"
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
 #include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/sys_proto.h>
+#include "emc.h"
+#include "cpu.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/mach-tegra/tegra114/clock.c +1 -2
index e6ef873c8dc4..7a73e159a7cd 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2015
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -13,7 +13,6 @@
 #include <asm/arch/sysctr.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/timer.h>
 #include <div64.h>
 #include <fdtdec.h>
 
arch/arm/mach-tegra/tegra124/clock.c +1 -2
index 1e71146236e9..1219b6413844 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2015
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -13,7 +13,6 @@
 #include <asm/arch/sysctr.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/timer.h>
 #include <div64.h>
 #include <fdtdec.h>
 
arch/arm/mach-tegra/tegra124/cpu.c +1 -3
index 0aca6583bacd..be31cb4ac881 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -7,14 +7,12 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ahb.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
-#include <asm/arch-tegra/ap.h>
 #include "../cpu.h"
 
 /* Tegra124-specific CPU init code */
arch/arm/mach-tegra/tegra124/psci.c +2 -1
index 16d196508c6e..08225e32dbd4 100644
@@ -1,6 +1,7 @@
 /*
  * (C) Copyright 2015, Siemens AG
  * Author: Jan Kiszka <[email protected]>
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -10,8 +11,8 @@
 #include <asm/psci.h>
 #include <asm/arch/flow.h>
 #include <asm/arch/powergate.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/pmc.h>
+#include "../cpu.h"
 
 static void park_cpu(void)
 {
arch/arm/mach-tegra/tegra20/clock.c +1 -2
index cd9fb9a55340..0ff538830abd 100644
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * (C) Copyright 2010-2015
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -14,7 +14,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/timer.h>
 #include <div64.h>
 #include <fdtdec.h>
 
arch/arm/mach-tegra/tegra20/display.c +2 -3
index 73be9a9cbd1f..52a476eb7d8a 100644
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2010
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -12,5 +12,4 @@
 #include <asm/arch/display.h>
 #include <asm/arch-tegra/dc.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/timer.h>
 
arch/arm/mach-tegra/tegra20/emc.c +1 -1
index ed2462ab0fa6..eab61b7cd2ab 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -7,7 +8,6 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <asm/io.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
arch/arm/mach-tegra/tegra20/pmu.c +2 -2
index a774246a2779..0da704cd4f3c 100644
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * (C) Copyright 2010,2011 NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016 NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -10,9 +10,9 @@
 #include <tps6586x.h>
 #include <asm/io.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/tegra_i2c.h>
 #include <asm/arch-tegra/sys_proto.h>
+#include "../cpu.h"
 
 #define VDD_CORE_NOMINAL_T25	0x17	/* 1.3v */
 #define VDD_CPU_NOMINAL_T25	0x10	/* 1.125v */
arch/arm/mach-tegra/tegra20/warmboot.c +2 -2
index 5fdc4bbb5007..1013441d4265 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010 - 2011
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -14,12 +14,12 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/sdram_param.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/fuse.h>
 #include <asm/arch-tegra/warmboot.h>
+#include "crypto.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/mach-tegra/tegra20/warmboot_avp.c +3 -3
index 27ce5f480f54..616358b657be 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010 - 2011
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -11,11 +11,11 @@
 #include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/warmboot.h>
+#include "../cpu.h"
 #include "warmboot_avp.h"
 
 #define DEBUG_RESET_CORESIGHT
@@ -204,7 +204,7 @@ void wb_start(void)
 
 	reg = SCLK_SWAKE_FIQ_SRC_PLLM_OUT1 | SCLK_SWAKE_IRQ_SRC_PLLM_OUT1 |
 	      SCLK_SWAKE_RUN_SRC_PLLM_OUT1 | SCLK_SWAKE_IDLE_SRC_PLLM_OUT1 |
-	      SCLK_SYS_STATE_IDLE;
+	      (SCLK_SYS_STATE_IDLE << SCLK_SYS_STATE_SHIFT);
 	writel(reg, &clkrst->crc_sclk_brst_pol);
 
 	/* avp_resume: no return after the write */
arch/arm/mach-tegra/tegra20/warmboot_avp.h +1 -5
index 7b86acb15632..85892b023fad 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010, 2011
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -12,9 +12,6 @@
 #define TEGRA_DEV_H			1
 #define TEGRA_DEV_U			2
 
-#define SIMPLE_PLLX			(CLOCK_ID_XCPU - CLOCK_ID_FIRST_SIMPLE)
-#define SIMPLE_PLLE			(CLOCK_ID_EPCI - CLOCK_ID_FIRST_SIMPLE)
-
 #define TIMER_USEC_CNTR			(NV_PA_TMRUS_BASE + 0)
 #define TIMER_USEC_CFG			(NV_PA_TMRUS_BASE + 4)
 
@@ -49,7 +46,6 @@
 #define PLLM_OUT1_CLKEN_ENABLE		(1 << 1)
 #define PLLM_OUT1_RATIO_VAL_8		(8 << 8)
 
-#define SCLK_SYS_STATE_IDLE		(1 << 28)
 #define SCLK_SWAKE_FIQ_SRC_PLLM_OUT1	(7 << 12)
 #define SCLK_SWAKE_IRQ_SRC_PLLM_OUT1	(7 << 8)
 #define SCLK_SWAKE_RUN_SRC_PLLM_OUT1	(7 << 4)
arch/arm/mach-tegra/tegra210/clock.c +1 -2
index f0052e7934a1..b025711acf09 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2015
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -14,7 +14,6 @@
 #include <asm/arch/sysctr.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/timer.h>
 #include <div64.h>
 #include <fdtdec.h>
 
arch/arm/mach-tegra/tegra30/clock.c +1 -2
index 1f104f288e57..98289b8ac7a7 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2015
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -13,7 +13,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/timer.h>
 #include <div64.h>
 #include <fdtdec.h>
 
board/avionic-design/common/tamonten.c +4 -5
index 9c8677943ad3..981862ce1aff 100644
@@ -1,8 +1,8 @@
 /*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation <www.nvidia.com>
- *  (C) Copyright 2011-2012
- *  Avionic Design GmbH <www.avionic-design.de>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2011-2012
+ * Avionic Design GmbH <www.avionic-design.de>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -18,7 +18,6 @@
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/sys_proto.h>
-#include <asm/arch-tegra/uart.h>
 
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 void gpio_early_init(void)
board/toradex/apalis_t30/apalis_t30.c +3 -3
index 3f56971a13b1..8fdee023ee8a 100644
@@ -1,6 +1,7 @@
 /*
- *  (C) Copyright 2014
- *  Marcel Ziswiler <[email protected]>
+ * (C) Copyright 2014
+ * Marcel Ziswiler <[email protected]>
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -8,7 +9,6 @@
 #include <common.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
board/toradex/colibri_t20/colibri_t20.c +2 -2
index 879f25a5384b..b9f845a09b6a 100644
@@ -1,5 +1,6 @@
 /*
- *  Copyright (C) 2012 Lucas Stach
+ * Copyright (C) 2012 Lucas Stach
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -8,7 +9,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/gpio.h>
board/toradex/colibri_t30/colibri_t30.c +3 -3
index 44b5beb92832..3902bff203d5 100644
@@ -1,6 +1,7 @@
 /*
- *  (C) Copyright 2014
- *  Stefan Agner <[email protected]>
+ * (C) Copyright 2014
+ * Stefan Agner <[email protected]>
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -8,7 +9,6 @@
 #include <common.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
drivers/i2c/tegra_i2c.c +2 -4
index 2fa07f9c57c4..0735ea0b2b12 100644
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
- * Copyright (c) 2010-2011 NVIDIA Corporation
- *  NVIDIA Corporation <www.nvidia.com>
+ * Copyright (c) 2010-2016 NVIDIA Corporation
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -292,7 +292,6 @@ static int tegra_i2c_write_data(struct i2c_bus *i2c_bus, u32 addr, u8 *data,
 	if (end_with_repeated_start)
 		trans_info.flags |= I2C_USE_REPEATED_START;
 	trans_info.num_bytes = len;
-	trans_info.is_10bit_address = 0;
 
 	error = send_recv_packets(i2c_bus, &trans_info);
 	if (error)
@@ -311,7 +310,6 @@ static int tegra_i2c_read_data(struct i2c_bus *i2c_bus, u32 addr, u8 *data,
 	trans_info.buf = data;
 	trans_info.flags = 0;
 	trans_info.num_bytes = len;
-	trans_info.is_10bit_address = 0;
 
 	error = send_recv_packets(i2c_bus, &trans_info);
 	if (error)
drivers/input/tegra-kbc.c +2 -3
index c77f61076962..349d95804201 100644
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2011
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2016
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -16,7 +16,6 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
-#include <asm/arch-tegra/timer.h>
 #include <linux/input.h>
 
 DECLARE_GLOBAL_DATA_PTR;
drivers/video/tegra.c +2 -1
index 7fd10e6af35e..13b10645478e 100644
@@ -1,5 +1,7 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
+ *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
@@ -17,7 +19,6 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/pwm.h>
 #include <asm/arch/display.h>
-#include <asm/arch-tegra/timer.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
include/configs/tegra-common.h +4 -6
index b07ee5645bb8..776394151661 100644
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2010-2012
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -84,7 +84,7 @@
 /* Boot Argument Buffer Size */
 #define CONFIG_SYS_BARGSIZE		(CONFIG_SYS_CBSIZE)
 
-#define CONFIG_SYS_MEMTEST_START	(NV_PA_SDRC_CS0 + 0x600000)
+#define CONFIG_SYS_MEMTEST_START	(NV_PA_SDRAM_BASE + 0x600000)
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + 0x100000)
 
 #ifndef CONFIG_ARM64
@@ -97,11 +97,9 @@
  * Physical Memory Map
  */
 #define CONFIG_NR_DRAM_BANKS	2
-#define PHYS_SDRAM_1		NV_PA_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE	0x20000000	/* 512M */
 
 #define CONFIG_SYS_UBOOT_START	CONFIG_SYS_TEXT_BASE
-#define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM_1
+#define CONFIG_SYS_SDRAM_BASE	NV_PA_SDRAM_BASE
 
 #define CONFIG_SYS_BOOTMAPSZ	(256 << 20)	/* 256M */
 
Signature · 1 line
2.8.1
#2 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

Quoted 75 lines · Stephen Warren

From: Stephen Warren <[email protected]>

arch/arm/include/asm/arch-tegra*/*.h have accumulated a fair number of unused definitions. This patch aims to delete them all.

While working on this, I noticed a few redundancies and fixed them. No doubt other redundancies still exist simply because I wasn't looking hard for them.

A few definitions were moved between files to allow deletion of headers.

Later changes will attempt to:
- Reduce the number of headers in the include directory.
- Move headers into arch/arm/mach-tegra/*, or into the same directory as the drivers they serve.
- Eliminate remaining duplication.
- Refactor the headers to allow addition of future SoC support, where those SoCs don't share many of the definitions currently located in common headers.

---
 arch/arm/include/asm/arch-tegra/ap.h         | 69 ---------------------
 arch/arm/include/asm/arch-tegra/clk_rst.h    | 81 +++----------------------
 arch/arm/include/asm/arch-tegra/clock.h      |  2 +-
 arch/arm/include/asm/arch-tegra/gp_padctrl.h |  6 +-
 arch/arm/include/asm/arch-tegra/gpio.h       |  4 +-
 arch/arm/include/asm/arch-tegra/pmc.h        | 19 +-----
 arch/arm/include/asm/arch-tegra/pwm.h        |  3 +-
 arch/arm/include/asm/arch-tegra/sys_proto.h  |  4 +-
 arch/arm/include/asm/arch-tegra/tegra.h      | 26 ++------
 arch/arm/include/asm/arch-tegra/tegra_i2c.h  | 11 +---
 arch/arm/include/asm/arch-tegra/tegra_mmc.h  |  4 +-
 arch/arm/include/asm/arch-tegra/timer.h      | 15 -----
 arch/arm/include/asm/arch-tegra/uart.h       | 31 ----------
 arch/arm/include/asm/arch-tegra/usb.h        |  5 +-
 arch/arm/include/asm/arch-tegra/warmboot.h   |  3 +-
 arch/arm/include/asm/arch-tegra124/ahb.h     | 91 ----------------------------
 arch/arm/include/asm/arch-tegra124/display.h | 58 ------------------
 arch/arm/include/asm/arch-tegra124/flow.h    |  8 +--
 arch/arm/include/asm/arch-tegra124/mc.h      |  3 +-
 arch/arm/include/asm/arch-tegra124/tegra.h   |  5 +-
 arch/arm/include/asm/arch-tegra20/tegra.h    |  4 +-
 arch/arm/include/asm/arch-tegra210/ahb.h     | 13 +---
 arch/arm/include/asm/arch-tegra210/clock.h   |  3 +-
 arch/arm/include/asm/arch-tegra210/flow.h    | 16 +----
 arch/arm/include/asm/arch-tegra210/mc.h      |  5 +-
 arch/arm/include/asm/arch-tegra210/tegra.h   |  5 +-
 arch/arm/include/asm/arch-tegra30/tegra.h    |  4 +-
 arch/arm/mach-tegra/ap.c                     | 10 +--
 arch/arm/mach-tegra/board.c                  | 11 ++--
 arch/arm/mach-tegra/board2.c                 |  6 +-
 arch/arm/mach-tegra/cache.c                  |  4 +-
 arch/arm/mach-tegra/clock.c                  |  4 +-
 arch/arm/mach-tegra/cpu.h                    | 34 +++++++----
 arch/arm/mach-tegra/emc.c                    |  5 +-
 arch/arm/mach-tegra/tegra114/clock.c         |  3 +-
 arch/arm/mach-tegra/tegra124/clock.c         |  3 +-
 arch/arm/mach-tegra/tegra124/cpu.c           |  4 +-
 arch/arm/mach-tegra/tegra124/psci.c          |  3 +-
 arch/arm/mach-tegra/tegra20/clock.c          |  3 +-
 arch/arm/mach-tegra/tegra20/display.c        |  5 +-
 arch/arm/mach-tegra/tegra20/emc.c            |  2 +-
 arch/arm/mach-tegra/tegra20/pmu.c            |  4 +-
 arch/arm/mach-tegra/tegra20/warmboot.c       |  4 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.c   |  6 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.h   |  6 +-
 arch/arm/mach-tegra/tegra210/clock.c         |  3 +-
 arch/arm/mach-tegra/tegra30/clock.c          |  3 +-
 board/avionic-design/common/tamonten.c       |  9 ++-
 board/toradex/apalis_t30/apalis_t30.c        |  6 +-
 board/toradex/colibri_t20/colibri_t20.c      |  4 +-
 board/toradex/colibri_t30/colibri_t30.c      |  6 +-
 drivers/i2c/tegra_i2c.c                      |  6 +-
 drivers/input/tegra-kbc.c                    |  5 +-
Quoted 8 lines
 drivers/video/tegra.c                        |  3 +-
 include/configs/tegra-common.h               | 10 ++-
 55 files changed, 117 insertions(+), 553 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra/ap.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/timer.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/uart.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/ahb.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/display.h
#3 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

In reply to Stephen Warren

Dear Stephen,

Quoted 1 line · In message <[email protected]> you wrote:

...

Quoted 3 lines

/*
* Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.

Can you please get rid of this "All rights reserved." ?

Please fix this globally in the whole patch set.

I assume it cannot be a problem to do that, as in other places you did not add this either, for example here:

arch/arm/include/asm/arch-tegra/gp_padctrl.h line 3

Quoted 8 lines
arch/arm/include/asm/arch-tegra/gp_padctrl.h +2 -2
@@ -1,6 +1,6 @@
 /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>

Thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
To be is to program.
#4 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

Quoted 10 lines · Wolfgang Denk

Dear Stephen,

Quoted 1 line · In message <[email protected]> you wrote:

...

Quoted 3 lines

/*
* Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.

Can you please get rid of this "All rights reserved." ?

Sorry, that is the format I'm required to use by NVIDIA legal.

To address your next question, "all rights reserved" is 100% compatible with OSS licenses. Equally, the phrase already exists throughout both the U-Boot and Linux kernel code-base (just a couple of prominent examples) for both NVIDIA's copyright notices, and those of many other prominent entities such as The Linux Foundation, Red Hat, Intel, The Chromium OS Authors, etc.

Quoted 5 lines

Please fix this globally in the whole patch set.

I assume it cannot be a problem to do that, as in other places you did not add this either, for example here:

Quoted 8 lines

arch/arm/include/asm/arch-tegra/gp_padctrl.h line 3

Quoted 8 lines
arch/arm/include/asm/arch-tegra/gp_padctrl.h +2 -2
@@ -1,6 +1,6 @@
  /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>

The primary purpose of this patch-set isn't to clean up copyright notices. As such, where I added new copyright notices I followed the format that NVIDIA legal requests me to. However, where I simply edited the date in existing notices I didn't do any other cleanup.

#5 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

Dear Stephen,

Quoted 11 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Can you please get rid of this "All rights reserved." ?

Sorry, that is the format I'm required to use by NVIDIA legal.

To address your next question, "all rights reserved" is 100% compatible with OSS licenses. Equally, the phrase already exists throughout both the U-Boot and Linux kernel code-base (just a couple of prominent examples) for both NVIDIA's copyright notices, and those of many other prominent entities such as The Linux Foundation, Red Hat, Intel, The Chromium OS Authors, etc.

Yes, I know these arguments. But actually this is b*llsh*t. Is there really no chance to drop that?

Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

- * (C) Copyright 2010-2015
- * NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>

The primary purpose of this patch-set isn't to clean up copyright notices. As such, where I added new copyright notices I followed the format that NVIDIA legal requests me to. However, where I simply edited the date in existing notices I didn't do any other cleanup.

Well, obviously other people were either notrequested to add this "All rights reserved." phrase, or found other ways to avoid it.

Can you please try to do the same?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Backed up the system lately?
#6 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

Quoted 15 lines · Wolfgang Denk

Dear Stephen,

Quoted 11 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Can you please get rid of this "All rights reserved." ?

Sorry, that is the format I'm required to use by NVIDIA legal.

To address your next question, "all rights reserved" is 100% compatible with OSS licenses. Equally, the phrase already exists throughout both the U-Boot and Linux kernel code-base (just a couple of prominent examples) for both NVIDIA's copyright notices, and those of many other prominent entities such as The Linux Foundation, Red Hat, Intel, The Chromium OS Authors, etc.

Quoted 2 lines

Yes, I know these arguments. But actually this is b*llsh*t. Is there really no chance to drop that?

I could ask NVIDIA legal again, but it's been discuss before and the guidance given was not changed, so I don't imagine it would be productive.

Quoted 10 lines
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

- * (C) Copyright 2010-2015
- * NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>

The primary purpose of this patch-set isn't to clean up copyright notices. As such, where I added new copyright notices I followed the format that NVIDIA legal requests me to. However, where I simply edited the date in existing notices I didn't do any other cleanup.

Quoted 4 lines

Well, obviously other people were either notrequested to add this "All rights reserved." phrase, or found other ways to avoid it.

Can you please try to do the same?

Given that message about says "2010" as the start date, I imagine the file was created (or copied blindly from another file that was created) before NVIDIA legal gave guidance for us to follow. I could only do the same by not following their current guidance, or claiming I forgot this time, which would be rather hard to do given this email thread. Either way, our internal systems will ding me for this when I rebase the copy of U-Boot we use internally, so I'll have to explain it then.

#7 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

In reply to Stephen Warren

Hi Stephen,

Quoted 27 lines · Stephen Warren
Quoted 6 lines · Wolfgang Denk

Dear Stephen,

Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 8 lines

...

Quoted 4 lines

/*
* Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.

Can you please get rid of this "All rights reserved." ?

Sorry, that is the format I'm required to use by NVIDIA legal.

To address your next question, "all rights reserved" is 100% compatible with OSS licenses. Equally, the phrase already exists throughout both the U-Boot and Linux kernel code-base (just a couple of prominent examples) for both NVIDIA's copyright notices, and those of many other prominent entities such as The Linux Foundation, Red Hat, Intel, The Chromium OS Authors, etc.

Quoted 5 lines

Please fix this globally in the whole patch set.

I assume it cannot be a problem to do that, as in other places you did not add this either, for example here:

Quoted 11 lines
Quoted 8 lines

arch/arm/include/asm/arch-tegra/gp_padctrl.h line 3

Quoted 8 lines
arch/arm/include/asm/arch-tegra/gp_padctrl.h +2 -2
@@ -1,6 +1,6 @@
  /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>

The primary purpose of this patch-set isn't to clean up copyright notices. As such, where I added new copyright notices I followed the format that NVIDIA legal requests me to. However, where I simply edited the date in existing notices I didn't do any other cleanup.

Perhaps you could consider just not updating the notices? It isn't required by U-Boot. I tend not to do it.

Also the all rights reserved thing is apparently pointless.

Regards,
Simon

#8 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

Quoted 42 lines · Simon Glass

Hi Stephen,

Quoted 27 lines · Stephen Warren
Quoted 6 lines · Wolfgang Denk

Dear Stephen,

Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 8 lines

...

Quoted 4 lines

/*
* Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.

Can you please get rid of this "All rights reserved." ?

Sorry, that is the format I'm required to use by NVIDIA legal.

To address your next question, "all rights reserved" is 100% compatible with OSS licenses. Equally, the phrase already exists throughout both the U-Boot and Linux kernel code-base (just a couple of prominent examples) for both NVIDIA's copyright notices, and those of many other prominent entities such as The Linux Foundation, Red Hat, Intel, The Chromium OS Authors, etc.

Quoted 5 lines

Please fix this globally in the whole patch set.

I assume it cannot be a problem to do that, as in other places you did not add this either, for example here:

Quoted 11 lines
Quoted 8 lines

arch/arm/include/asm/arch-tegra/gp_padctrl.h line 3

Quoted 8 lines
arch/arm/include/asm/arch-tegra/gp_padctrl.h +2 -2
@@ -1,6 +1,6 @@
   /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>

The primary purpose of this patch-set isn't to clean up copyright notices. As such, where I added new copyright notices I followed the format that NVIDIA legal requests me to. However, where I simply edited the date in existing notices I didn't do any other cleanup.

Quoted 4 lines

Perhaps you could consider just not updating the notices? It isn't required by U-Boot. I tend not to do it.

Also the all rights reserved thing is apparently pointless.

NVIDIA legal says I have to.

I believe the only choice I have is whether to contribute to U-Boot.

That said, I will go and double check again.

#9 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

Hi Stephen,

Quoted 63 lines · Stephen Warren
Quoted 62 lines · Simon Glass

Hi Stephen,

Quoted 38 lines · Stephen Warren
Quoted 12 lines · Wolfgang Denk

Dear Stephen,

In message <[email protected]> you

Quoted 3 lines · wrote:

...

Quoted 2 lines
Quoted 7 lines
Quoted 3 lines

/*
* Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.

Can you please get rid of this "All rights reserved." ?

Sorry, that is the format I'm required to use by NVIDIA legal.

To address your next question, "all rights reserved" is 100% compatible with OSS licenses. Equally, the phrase already exists throughout both the U-Boot and Linux kernel code-base (just a couple of prominent examples) for both NVIDIA's copyright notices, and those of many other prominent entities such as The Linux Foundation, Red Hat, Intel, The Chromium OS Authors, etc.

Quoted 5 lines

Please fix this globally in the whole patch set.

I assume it cannot be a problem to do that, as in other places you did not add this either, for example here:

Quoted 15 lines
Quoted 8 lines

arch/arm/include/asm/arch-tegra/gp_padctrl.h line 3

Quoted 8 lines
arch/arm/include/asm/arch-tegra/gp_padctrl.h +2 -2
@@ -1,6 +1,6 @@
   /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>

The primary purpose of this patch-set isn't to clean up copyright notices. As such, where I added new copyright notices I followed the format that NVIDIA legal requests me to. However, where I simply edited the date in existing notices I didn't do any other cleanup.

Perhaps you could consider just not updating the notices? It isn't required by U-Boot. I tend not to do it.

Quoted 8 lines
Quoted 1 line

Also the all rights reserved thing is apparently pointless.

NVIDIA legal says I have to.

I believe the only choice I have is whether to contribute to U-Boot.

That said, I will go and double check again.

Also point them to this:

https://en.wikipedia.org/wiki/All_rights_reserved

I recall a similar discussion before...

Regards,
Simon

#10 lore raw

PATCH 1/60 ARM: tegra: remove unused definitions in headers

In reply to Stephen Warren
Quoted 46 lines · Stephen Warren
Quoted 45 lines · Simon Glass

Hi Stephen,

Quoted 27 lines · Stephen Warren
Quoted 6 lines · Wolfgang Denk

Dear Stephen,

Quoted 2 lines · In message <[email protected]> you wrote:
Quoted 8 lines

...

Quoted 4 lines

/*
* Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.

Can you please get rid of this "All rights reserved." ?

Sorry, that is the format I'm required to use by NVIDIA legal.

To address your next question, "all rights reserved" is 100% compatible with OSS licenses. Equally, the phrase already exists throughout both the U-Boot and Linux kernel code-base (just a couple of prominent examples) for both NVIDIA's copyright notices, and those of many other prominent entities such as The Linux Foundation, Red Hat, Intel, The Chromium OS Authors, etc.

Quoted 5 lines

Please fix this globally in the whole patch set.

I assume it cannot be a problem to do that, as in other places you did not add this either, for example here:

Quoted 11 lines
Quoted 8 lines

arch/arm/include/asm/arch-tegra/gp_padctrl.h line 3

Quoted 8 lines
arch/arm/include/asm/arch-tegra/gp_padctrl.h +2 -2
@@ -1,6 +1,6 @@
  /*
- *  (C) Copyright 2010-2015
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>

The primary purpose of this patch-set isn't to clean up copyright notices. As such, where I added new copyright notices I followed the format that NVIDIA legal requests me to. However, where I simply edited the date in existing notices I didn't do any other cleanup.

Perhaps you could consider just not updating the notices? It isn't required by U-Boot. I tend not to do it.

Quoted 7 lines
Quoted 1 line

Also the all rights reserved thing is apparently pointless.

NVIDIA legal says I have to.

I believe the only choice I have is whether to contribute to U-Boot.

That said, I will go and double check again.

Please do go double check. Full disclosure, it's not something that's a dealbreaker for contributions, but I'd still rather not see it be added.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160425/7dba8d4a/attachment.sig>
#11 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

The initialization performed by this code is SoC-specific not board- specific. It also solely touches MMC controller registers. As such, it should be part of the MMC driver itself. Move it there.

---
 arch/arm/include/asm/arch-tegra/tegra_mmc.h |  2 --
 arch/arm/mach-tegra/board2.c                | 29 --------------------------
 drivers/mmc/tegra_mmc.c                     | 32 +++++++++++++++++++++++++++--
 3 files changed, 30 insertions(+), 33 deletions(-)
arch/arm/include/asm/arch-tegra/tegra_mmc.h +0 -2
index 9b371add1de4..adc9772a3c18 100644
@@ -142,6 +142,4 @@ struct mmc_host {
 	struct mmc_config cfg;	/* mmc configuration */
 };
 
-void pad_init_mmc(struct mmc_host *host);
-
 #endif	/* __TEGRA_MMC_H_ */
arch/arm/mach-tegra/board2.c +0 -29
index 33e346017a8b..98fd94646909 100644
@@ -31,7 +31,6 @@
 #include <usb.h>
 #endif
 #ifdef CONFIG_TEGRA_MMC
-#include <asm/arch-tegra/tegra_mmc.h>
 #include <asm/arch-tegra/mmc.h>
 #endif
 #include <asm/arch-tegra/xusb-padctl.h>
@@ -246,34 +245,6 @@ int board_mmc_init(bd_t *bd)
 
 	return 0;
 }
-
-void pad_init_mmc(struct mmc_host *host)
-{
-#if defined(CONFIG_TEGRA30)
-	enum periph_id id = host->mmc_id;
-	u32 val;
-
-	debug("%s: sdmmc address = %08x, id = %d\n", __func__,
-		(unsigned int)host->reg, id);
-
-	/* Set the pad drive strength for SDMMC1 or 3 only */
-	if (id != PERIPH_ID_SDMMC1 && id != PERIPH_ID_SDMMC3) {
-		debug("%s: settings are only valid for SDMMC1/SDMMC3!\n",
-			__func__);
-		return;
-	}
-
-	val = readl(&host->reg->sdmemcmppadctl);
-	val &= 0xFFFFFFF0;
-	val |= MEMCOMP_PADCTRL_VREF;
-	writel(val, &host->reg->sdmemcmppadctl);
-
-	val = readl(&host->reg->autocalcfg);
-	val &= 0xFFFF0000;
-	val |= AUTO_CAL_PU_OFFSET | AUTO_CAL_PD_OFFSET | AUTO_CAL_ENABLED;
-	writel(val, &host->reg->autocalcfg);
-#endif	/* T30 */
-}
 #endif	/* MMC */
 
 /*
drivers/mmc/tegra_mmc.c +30 -2
index 573819a01e21..23c6c2cf4583 100644
@@ -1,8 +1,8 @@
 /*
+ * Copyright 2011-2016 NVIDIA Corporation
  * (C) Copyright 2009 SAMSUNG Electronics
  * Minkyu Kang <[email protected]>
  * Jaehoon Chung <[email protected]>
- * Portions Copyright 2011-2015 NVIDIA Corporation
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -428,6 +428,34 @@ static void tegra_mmc_set_ios(struct mmc *mmc)
 	debug("mmc_set_ios: hostctl = %08X\n", ctrl);
 }
 
+static void tegra_mmc_pad_init(struct mmc_host *host)
+{
+#if defined(CONFIG_TEGRA30)
+	enum periph_id id = host->mmc_id;
+	u32 val;
+
+	debug("%s: sdmmc address = %08x, id = %d\n", __func__,
+	      (unsigned int)host->reg, id);
+
+	/* Set the pad drive strength for SDMMC1 or 3 only */
+	if (id != PERIPH_ID_SDMMC1 && id != PERIPH_ID_SDMMC3) {
+		debug("%s: settings are only valid for SDMMC1/SDMMC3!\n",
+		      __func__);
+		return;
+	}
+
+	val = readl(&host->reg->sdmemcmppadctl);
+	val &= 0xFFFFFFF0;
+	val |= MEMCOMP_PADCTRL_VREF;
+	writel(val, &host->reg->sdmemcmppadctl);
+
+	val = readl(&host->reg->autocalcfg);
+	val &= 0xFFFF0000;
+	val |= AUTO_CAL_PU_OFFSET | AUTO_CAL_PD_OFFSET | AUTO_CAL_ENABLED;
+	writel(val, &host->reg->autocalcfg);
+#endif	/* T30 */
+}
+
 static void mmc_reset(struct mmc_host *host, struct mmc *mmc)
 {
 	unsigned int timeout;
@@ -461,7 +489,7 @@ static void mmc_reset(struct mmc_host *host, struct mmc *mmc)
 		readb(&host->reg->pwrcon), readb(&host->reg->hostctl));
 
 	/* Make sure SDIO pads are set up */
-	pad_init_mmc(host);
+	tegra_mmc_pad_init(host);
 }
 
 static int tegra_mmc_core_init(struct mmc *mmc)
Signature · 1 line
2.8.1
#12 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 6 lines · Stephen Warren

From: Stephen Warren <[email protected]>

The initialization performed by this code is SoC-specific not board- specific. It also solely touches MMC controller registers. As such, it should be part of the MMC driver itself. Move it there.

Quoted 6 lines
---
 arch/arm/include/asm/arch-tegra/tegra_mmc.h |  2 --
 arch/arm/mach-tegra/board2.c                | 29 --------------------------
 drivers/mmc/tegra_mmc.c                     | 32 +++++++++++++++++++++++++++--
 3 files changed, 30 insertions(+), 33 deletions(-)
#13 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

In reply to Stephen Warren

Dear Stephen,

Quoted 10 lines · In message <[email protected]> you wrote:

/*
+ * Copyright 2011-2016 NVIDIA Corporation
* (C) Copyright 2009 SAMSUNG Electronics
* Minkyu Kang <[email protected]>
* Jaehoon Chung <[email protected]>
- * Portions Copyright 2011-2015 NVIDIA Corporation *
* SPDX-License-Identifier: GPL-2.0+
*/

Both the change of the position of the copyright note and the rewording contain a subtle but still significant change of meaning.

Now it seems as if Nvidia was the major copyright holder. Is this intentional?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Conceptual integrity in turn dictates that the  design  must  proceed
from  one  mind,  or  from  a  very small number of agreeing resonant
minds.               - Frederick Brooks Jr., "The Mythical Man Month" 
#14 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 14 lines · Wolfgang Denk

Dear Stephen,

Quoted 10 lines · In message <[email protected]> you wrote:

/*
+ * Copyright 2011-2016 NVIDIA Corporation
* (C) Copyright 2009 SAMSUNG Electronics
* Minkyu Kang <[email protected]>
* Jaehoon Chung <[email protected]>
- * Portions Copyright 2011-2015 NVIDIA Corporation *
* SPDX-License-Identifier: GPL-2.0+
*/

Quoted 5 lines

Both the change of the position of the copyright note and the rewording contain a subtle but still significant change of meaning.

Now it seems as if Nvidia was the major copyright holder. Is this intentional?

I was not aware that the order actually implied anything. I would imagine the copyright dates and "git blame" output were more relevant since they pin-point specific changes, whereas copyright headers don't have the detail to convey the whole picture.

In this case, both "git log" and "git blame" certainly show that NVIDIA is the primary author of this code. I deliberately removed "Portions" because it was something uncommon and seems inaccurate. I don't recall why I changed the order; probably because I was editing a lot of files and just happened to paste the message there. I imagine the Samsung copyright notice is only there because the general structure of the file (set of functions implemented) was based on an existing driver, rather than because any of the non-boilerplate code was written by them.

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

#15 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Dear Stephen Warren,

Quoted 18 lines · In message <[email protected]> you wrote:
Quoted 17 lines · Wolfgang Denk

Dear Stephen,

Quoted 10 lines · In message <[email protected]> you wrote:

/*
+ * Copyright 2011-2016 NVIDIA Corporation
* (C) Copyright 2009 SAMSUNG Electronics
* Minkyu Kang <[email protected]>
* Jaehoon Chung <[email protected]>
- * Portions Copyright 2011-2015 NVIDIA Corporation *
* SPDX-License-Identifier: GPL-2.0+
*/

Both the change of the position of the copyright note and the rewording contain a subtle but still significant change of meaning.

Quoted 7 lines
Quoted 2 lines

Now it seems as if Nvidia was the major copyright holder. Is this intentional?

I was not aware that the order actually implied anything. I would imagine the copyright dates and "git blame" output were more relevant since they pin-point specific changes, whereas copyright headers don't have the detail to convey the whole picture.

Well, just read the text before and after the patch, and let the meaning sink in...

Quoted 8 lines

In this case, both "git log" and "git blame" certainly show that NVIDIA is the primary author of this code. I deliberately removed "Portions" because it was something uncommon and seems inaccurate. I don't recall why I changed the order; probably because I was editing a lot of files and just happened to paste the message there. I imagine the Samsung copyright notice is only there because the general structure of the file (set of functions implemented) was based on an existing driver, rather than because any of the non-boilerplate code was written by them.

I did not check this, and I don't intend to do so. you may actually be right, and your modification may be perfectly OK.

But from just reading the patch, it leaves a stale aftertaste.

Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

It is difficult for any outside party to verify this. I feel such changes require a lot of tact, and global edits are probably not a
good idea. You know that I don't post very often lately, so you can
imagine that this must have stirred me a bit.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
NOTE: The  Most  Fundamental  Particles  in  This  Product  Are  Held
Together  by  a  "Gluing" Force About Which Little is Currently Known
and Whose Adhesive Power Can Therefore Not Be Permanently Guaranteed.
#16 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160425/49709111/attachment.sig>
#17 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 12 lines · Tom Rini
Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

Quoted 3 lines

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Personally I want to spend my time coding rather than dealing with licensing. As such, it's easy to forget to update the dates in copyright notices when changing files, or to put the correct information into new files when creating new ones (often by just cutting/pasting some other file with similar issues). If we had done that 100% correctly in every commit across history, my inclination is that more files would already have an NVIDIA copyright message, and/or already have 2016 in the date, and hence this series wouldn't include an edit to those messages since they'd already be up-to-date. Still, I have no searched all history to confirm that; it's just my gut instinct.

#18 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 17 lines · Stephen Warren
Quoted 12 lines · Tom Rini
Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

Quoted 3 lines

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Quoted 11 lines

Personally I want to spend my time coding rather than dealing with licensing. As such, it's easy to forget to update the dates in copyright notices when changing files, or to put the correct information into new files when creating new ones (often by just cutting/pasting some other file with similar issues). If we had done that 100% correctly in every commit across history, my inclination is that more files would already have an NVIDIA copyright message, and/or already have 2016 in the date, and hence this series wouldn't include an edit to those messages since they'd already be up-to-date. Still, I have no searched all history to confirm that; it's just my gut instinct.

Right, OK. So you're saying you may, in some cases, be adding 2016 to files you haven't touched this year yet?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160425/65681e95/attachment.sig>
#19 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 30 lines · Tom Rini
Quoted 17 lines · Stephen Warren
Quoted 12 lines · Tom Rini
Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

Quoted 3 lines

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Quoted 11 lines

Personally I want to spend my time coding rather than dealing with licensing. As such, it's easy to forget to update the dates in copyright notices when changing files, or to put the correct information into new files when creating new ones (often by just cutting/pasting some other file with similar issues). If we had done that 100% correctly in every commit across history, my inclination is that more files would already have an NVIDIA copyright message, and/or already have 2016 in the date, and hence this series wouldn't include an edit to those messages since they'd already be up-to-date. Still, I have no searched all history to confirm that; it's just my gut instinct.

Quoted 2 lines

Right, OK. So you're saying you may, in some cases, be adding 2016 to files you haven't touched this year yet?

Yes, I'm sure there's a mix.

#20 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 31 lines · Stephen Warren
Quoted 30 lines · Tom Rini
Quoted 28 lines · Stephen Warren
Quoted 12 lines · Tom Rini
Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

Quoted 3 lines

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Personally I want to spend my time coding rather than dealing with licensing. As such, it's easy to forget to update the dates in copyright notices when changing files, or to put the correct information into new files when creating new ones (often by just cutting/pasting some other file with similar issues). If we had done that 100% correctly in every commit across history, my inclination is that more files would already have an NVIDIA copyright message, and/or already have 2016 in the date, and hence this series wouldn't include an edit to those messages since they'd already be up-to-date. Still, I have no searched all history to confirm that; it's just my gut instinct.

Quoted 4 lines
Quoted 2 lines

Right, OK. So you're saying you may, in some cases, be adding 2016 to files you haven't touched this year yet?

Yes, I'm sure there's a mix.

OK. And I assume you're globbing on file paths to check / update? Doing you can do 'git log --since=YYYY-01-01-YYYY-12-31' to find the first/last commits in a given year, git diff a..b | diffstat > Y.txt to get a diffstat and check your numbers vs that. This doesn't feel like an undue burden on making sure copyright stuff is year-correct for last-touch.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160425/dba60250/attachment.sig>
#21 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 35 lines · Tom Rini
Quoted 34 lines · Stephen Warren
Quoted 32 lines · Tom Rini
Quoted 17 lines · Stephen Warren
Quoted 12 lines · Tom Rini
Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

Quoted 3 lines

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Quoted 11 lines

Personally I want to spend my time coding rather than dealing with licensing. As such, it's easy to forget to update the dates in copyright notices when changing files, or to put the correct information into new files when creating new ones (often by just cutting/pasting some other file with similar issues). If we had done that 100% correctly in every commit across history, my inclination is that more files would already have an NVIDIA copyright message, and/or already have 2016 in the date, and hence this series wouldn't include an edit to those messages since they'd already be up-to-date. Still, I have no searched all history to confirm that; it's just my gut instinct.

Right, OK. So you're saying you may, in some cases, be adding 2016 to files you haven't touched this year yet?

Quoted 8 lines
Quoted 1 line

Yes, I'm sure there's a mix.

OK. And I assume you're globbing on file paths to check / update? Doing you can do 'git log --since=YYYY-01-01-YYYY-12-31' to find the first/last commits in a given year, git diff a..b | diffstat > Y.txt to get a diffstat and check your numbers vs that. This doesn't feel like an undue burden on making sure copyright stuff is year-correct for last-touch.

Well, by "yet" I assumed you mean "before this patch set". There are no changes in the patch set that do nothing but edit/add a copyright notice without making other changes. The only edits to copyrights in this series are because I've edited files for the purpose behind the patch, and then have updated the copyright while doing so.

What I did was:
a) Make all the changes.
b) Go through all the patches with "git rebase -i", get the list of files edited in the patch, and ensure the copyright date reflected the edit made in that patch.

BTW, while code re-org is not the most involved of coding, I don't see a reason to make developers decide legal issues such as what amounts to a change that's large enough to change the copyright date, or add a copyright header. The rule should be simple and unambiguous (edit a file -> change the copyright); anything else is asking for different people to argue over interpretation, which just everybody's wastes time. Let's leave that to lawyers and just deal with code.

#22 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 51 lines · Stephen Warren
Quoted 35 lines · Tom Rini
Quoted 34 lines · Stephen Warren
Quoted 32 lines · Tom Rini
Quoted 17 lines · Stephen Warren
Quoted 12 lines · Tom Rini
Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

Quoted 3 lines

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Quoted 11 lines

Personally I want to spend my time coding rather than dealing with licensing. As such, it's easy to forget to update the dates in copyright notices when changing files, or to put the correct information into new files when creating new ones (often by just cutting/pasting some other file with similar issues). If we had done that 100% correctly in every commit across history, my inclination is that more files would already have an NVIDIA copyright message, and/or already have 2016 in the date, and hence this series wouldn't include an edit to those messages since they'd already be up-to-date. Still, I have no searched all history to confirm that; it's just my gut instinct.

Right, OK. So you're saying you may, in some cases, be adding 2016 to files you haven't touched this year yet?

Quoted 8 lines
Quoted 1 line

Yes, I'm sure there's a mix.

OK. And I assume you're globbing on file paths to check / update? Doing you can do 'git log --since=YYYY-01-01-YYYY-12-31' to find the first/last commits in a given year, git diff a..b | diffstat > Y.txt to get a diffstat and check your numbers vs that. This doesn't feel like an undue burden on making sure copyright stuff is year-correct for last-touch.

Well, by "yet" I assumed you mean "before this patch set". There are no changes in the patch set that do nothing but edit/add a copyright notice without making other changes. The only edits to copyrights in this series are because I've edited files for the purpose behind the patch, and then have updated the copyright while doing so.

Quoted 5 lines

What I did was:
a) Make all the changes.
b) Go through all the patches with "git rebase -i", get the list of files edited in the patch, and ensure the copyright date reflected the edit made in that patch.

OK. This should make any quick sanity checks easier, rather than harder. Generate the lists, diffstat your series, for F in series, grep -q year-list && echo touched $F;done

Quoted 8 lines

BTW, while code re-org is not the most involved of coding, I don't see a reason to make developers decide legal issues such as what amounts to a change that's large enough to change the copyright date, or add a copyright header. The rule should be simple and unambiguous (edit a file -> change the copyright); anything else is asking for different people to argue over interpretation, which just everybody's wastes time. Let's leave that to lawyers and just deal with code.

I agree in spirit, with a caveat about meeting a significance threshold. I think you need to push back on your legal department if they are asking that every change requires a copyright notice, regardless of length or complexity. I _cannot_ start having patches conflict because the contents are fine but now I have to fixup the copyright notices added since the patch was generated, and then I suppose toss in my own copyright too, because now I've made some change to the file. Since you mentioned the kernel, I just popped open git log -p in the kernel and I do not see a flood of "made a change, add/update copyright".

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160425/9fec52b6/attachment.sig>
#23 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 71 lines · Tom Rini
Quoted 51 lines · Stephen Warren
Quoted 35 lines · Tom Rini
Quoted 34 lines · Stephen Warren
Quoted 32 lines · Tom Rini
Quoted 17 lines · Stephen Warren
Quoted 12 lines · Tom Rini
Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

Quoted 3 lines

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Quoted 11 lines

Personally I want to spend my time coding rather than dealing with licensing. As such, it's easy to forget to update the dates in copyright notices when changing files, or to put the correct information into new files when creating new ones (often by just cutting/pasting some other file with similar issues). If we had done that 100% correctly in every commit across history, my inclination is that more files would already have an NVIDIA copyright message, and/or already have 2016 in the date, and hence this series wouldn't include an edit to those messages since they'd already be up-to-date. Still, I have no searched all history to confirm that; it's just my gut instinct.

Right, OK. So you're saying you may, in some cases, be adding 2016 to files you haven't touched this year yet?

Quoted 8 lines
Quoted 1 line

Yes, I'm sure there's a mix.

OK. And I assume you're globbing on file paths to check / update? Doing you can do 'git log --since=YYYY-01-01-YYYY-12-31' to find the first/last commits in a given year, git diff a..b | diffstat > Y.txt to get a diffstat and check your numbers vs that. This doesn't feel like an undue burden on making sure copyright stuff is year-correct for last-touch.

Well, by "yet" I assumed you mean "before this patch set". There are no changes in the patch set that do nothing but edit/add a copyright notice without making other changes. The only edits to copyrights in this series are because I've edited files for the purpose behind the patch, and then have updated the copyright while doing so.

Quoted 5 lines

What I did was:
a) Make all the changes.
b) Go through all the patches with "git rebase -i", get the list of files edited in the patch, and ensure the copyright date reflected the edit made in that patch.

OK. This should make any quick sanity checks easier, rather than harder. Generate the lists, diffstat your series, for F in series, grep -q year-list && echo touched $F;done

Quoted 8 lines

BTW, while code re-org is not the most involved of coding, I don't see a reason to make developers decide legal issues such as what amounts to a change that's large enough to change the copyright date, or add a copyright header. The rule should be simple and unambiguous (edit a file -> change the copyright); anything else is asking for different people to argue over interpretation, which just everybody's wastes time. Let's leave that to lawyers and just deal with code.

Quoted 6 lines

I agree in spirit, with a caveat about meeting a significance threshold. I think you need to push back on your legal department if they are asking that every change requires a copyright notice, regardless of length or complexity. I _cannot_ start having patches conflict because the contents are fine but now I have to fixup the copyright notices added since the patch was generated,

I'm not sure why. Let's say the two conflicting patches are both unambiguously significant works, by two different people/entities. Surely there's no issue with the copyright notices both being added/updated in that case? If so, then the only difference is the volume of conflicts. Volume doesn't seem a great argument since it's not a problem with the core issue itself.

#24 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

Quoted 79 lines · Stephen Warren
Quoted 71 lines · Tom Rini
Quoted 51 lines · Stephen Warren
Quoted 35 lines · Tom Rini
Quoted 34 lines · Stephen Warren
Quoted 32 lines · Tom Rini
Quoted 17 lines · Stephen Warren
Quoted 12 lines · Tom Rini
Quoted 3 lines · Wolfgang Denk

Dear Stephen Warren,

In message <[email protected]> you wrote:

[snip]

Quoted 6 lines
Quoted 6 lines

Unfortunately we've (NVIDIA at least) been a little lax making sure the NVIDIA copyright messages are kept up-to-date when editing files, hence why this series had to change a lot of them for the first time recently. If we went back and re-wrote all of git history paying strict attention to the copyright notice dates and formatting, I imagine the set of copyright-related changes in this series would be much smaller.

Quoted 3 lines

I'm quoting Wolfgang's email here, but, yes, keeping the copyright notices correct is important. Now, what do you mean by would be smaller?

Quoted 11 lines

Personally I want to spend my time coding rather than dealing with licensing. As such, it's easy to forget to update the dates in copyright notices when changing files, or to put the correct information into new files when creating new ones (often by just cutting/pasting some other file with similar issues). If we had done that 100% correctly in every commit across history, my inclination is that more files would already have an NVIDIA copyright message, and/or already have 2016 in the date, and hence this series wouldn't include an edit to those messages since they'd already be up-to-date. Still, I have no searched all history to confirm that; it's just my gut instinct.

Right, OK. So you're saying you may, in some cases, be adding 2016 to files you haven't touched this year yet?

Quoted 8 lines
Quoted 1 line

Yes, I'm sure there's a mix.

OK. And I assume you're globbing on file paths to check / update? Doing you can do 'git log --since=YYYY-01-01-YYYY-12-31' to find the first/last commits in a given year, git diff a..b | diffstat > Y.txt to get a diffstat and check your numbers vs that. This doesn't feel like an undue burden on making sure copyright stuff is year-correct for last-touch.

Well, by "yet" I assumed you mean "before this patch set". There are no changes in the patch set that do nothing but edit/add a copyright notice without making other changes. The only edits to copyrights in this series are because I've edited files for the purpose behind the patch, and then have updated the copyright while doing so.

Quoted 5 lines

What I did was:
a) Make all the changes.
b) Go through all the patches with "git rebase -i", get the list of files edited in the patch, and ensure the copyright date reflected the edit made in that patch.

OK. This should make any quick sanity checks easier, rather than harder. Generate the lists, diffstat your series, for F in series, grep -q year-list && echo touched $F;done

Quoted 8 lines

BTW, while code re-org is not the most involved of coding, I don't see a reason to make developers decide legal issues such as what amounts to a change that's large enough to change the copyright date, or add a copyright header. The rule should be simple and unambiguous (edit a file -> change the copyright); anything else is asking for different people to argue over interpretation, which just everybody's wastes time. Let's leave that to lawyers and just deal with code.

Quoted 6 lines

I agree in spirit, with a caveat about meeting a significance threshold. I think you need to push back on your legal department if they are asking that every change requires a copyright notice, regardless of length or complexity. I _cannot_ start having patches conflict because the contents are fine but now I have to fixup the copyright notices added since the patch was generated,

Quoted 6 lines

I'm not sure why. Let's say the two conflicting patches are both unambiguously significant works, by two different people/entities. Surely there's no issue with the copyright notices both being added/updated in that case? If so, then the only difference is the volume of conflicts. Volume doesn't seem a great argument since it's not a problem with the core issue itself.

The problem here is that much of this series is not making unambiguously significant changes. I do not have a problem with (but maybe I need to chat with the Software Freedom Conservancy folks more) adding / extending copyrights when adding significant changes to existing files nor adding them to new files.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160426/f697cadc/attachment.sig>
#25 lore raw

PATCH 2/60 mmc: tegra: move pad init into MMC driver

In reply to Stephen Warren

Dear Stephen,

Quoted 8 lines · In message <[email protected]> you wrote:

BTW, while code re-org is not the most involved of coding, I don't see a reason to make developers decide legal issues such as what amounts to a change that's large enough to change the copyright date, or add a copyright header. The rule should be simple and unambiguous (edit a file -> change the copyright); anything else is asking for different people to argue over interpretation, which just everybody's wastes time. Let's leave that to lawyers and just deal with code.

There is no simple rule. Adding a copyright header means you claim your (or your company's) copyright, i. e. you are referring to legal rules, which ar inherently non-trivial. even more so, as this is a multi-national project - even though nternation copyright laws are pretty much similar worldwide (there are international treaties like the Berne convention), there may still be differences.

One area where (to the best of my knowledge - IANAL) there appears to be agreement is that you must meet some "Creativity Requirement" with the work you created to make it copyrightable at all.

Moving two include lines around is not really creative, and I feel sad that we have to go into such lengthy discussions here.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A good aphorism is too hard for the tooth of time, and  is  not  worn
away  by  all  the  centuries,  although  it serves as food for every
epoch.                                  - Friedrich Wilhelm Nietzsche
                          _Miscellaneous Maxims and Opinions_ no. 168
#26 lore raw

PATCH 3/60 mmc: tegra: move header file to driver directory

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

tegra_mmc.h only contains private definitions for use inside the MMC driver. Move it out of the global include directory since nothing needs to access it there.

tegra_mmc.h doesn't depend on anything from <fdtdec.h>, so move that include to the C file.

---
 drivers/mmc/tegra_mmc.c                                            | 3 ++-
 .../asm/arch-tegra/tegra_mmc.h => drivers/mmc/tegra_mmc_priv.h     | 7 +++----
 2 files changed, 5 insertions(+), 5 deletions(-)
 rename arch/arm/include/asm/arch-tegra/tegra_mmc.h => drivers/mmc/tegra_mmc_priv.h (98%)
drivers/mmc/tegra_mmc.c +2 -1
index 23c6c2cf4583..12b14fc35d08 100644
@@ -9,13 +9,14 @@
 
 #include <bouncebuf.h>
 #include <common.h>
+#include <fdtdec.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/mmc.h>
-#include <asm/arch-tegra/tegra_mmc.h>
 #include <mmc.h>
+#include "tegra_mmc_priv.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/mmc/tegra_mmc_priv.h renamed from arch/arm/include/asm/arch-tegra/tegra_mmc.h +3 -4
similarity index 98%
rename from arch/arm/include/asm/arch-tegra/tegra_mmc.h
rename to drivers/mmc/tegra_mmc_priv.h
index adc9772a3c18..3d9bcb78187c 100644
@@ -6,10 +6,9 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef __TEGRA_MMC_H_
-#define __TEGRA_MMC_H_
+#ifndef __TEGRA_MMC_PRIV_H_
+#define __TEGRA_MMC_PRIV_H_
 
-#include <fdtdec.h>
 #include <asm/gpio.h>
 
 /* for mmc_config definition */
@@ -142,4 +141,4 @@ struct mmc_host {
 	struct mmc_config cfg;	/* mmc configuration */
 };
 
-#endif	/* __TEGRA_MMC_H_ */
+#endif
Signature · 1 line
2.8.1
#27 lore raw

PATCH 3/60 mmc: tegra: move header file to driver directory

Quoted 9 lines · Stephen Warren

From: Stephen Warren <[email protected]>

tegra_mmc.h only contains private definitions for use inside the MMC driver. Move it out of the global include directory since nothing needs to access it there.

tegra_mmc.h doesn't depend on anything from <fdtdec.h>, so move that include to the C file.

Quoted 6 lines
---
 drivers/mmc/tegra_mmc.c                                            | 3 ++-
 .../asm/arch-tegra/tegra_mmc.h => drivers/mmc/tegra_mmc_priv.h     | 7 +++----
 2 files changed, 5 insertions(+), 5 deletions(-)
 rename arch/arm/include/asm/arch-tegra/tegra_mmc.h => drivers/mmc/tegra_mmc_priv.h (98%)
#28 lore raw

PATCH 4/60 mmc: tegra: move public header to arch/arm/mach-tegra/include

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Machine-specific headers should be in this location. Eventually, we'll move all headers from arch/arm/include to arch/arm/mach-tegra/include, or find a way to delete them.

---
 arch/arm/mach-tegra/board2.c                                       | 2 +-
 .../asm/arch-tegra/mmc.h => mach-tegra/include/mach/tegra_mmc.h}   | 7 ++++---
 drivers/mmc/tegra_mmc.c                                            | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)
 rename arch/arm/{include/asm/arch-tegra/mmc.h => mach-tegra/include/mach/tegra_mmc.h} (50%)
arch/arm/mach-tegra/board2.c +1 -1
index 98fd94646909..05e83268cd40 100644
@@ -31,7 +31,7 @@
 #include <usb.h>
 #endif
 #ifdef CONFIG_TEGRA_MMC
-#include <asm/arch-tegra/mmc.h>
+#include <mach/tegra_mmc.h>
 #endif
 #include <asm/arch-tegra/xusb-padctl.h>
 #include <power/as3722.h>
arch/arm/mach-tegra/include/mach/tegra_mmc.h renamed from arch/arm/include/asm/arch-tegra/mmc.h +4 -3
similarity index 50%
rename from arch/arm/include/asm/arch-tegra/mmc.h
rename to arch/arm/mach-tegra/include/mach/tegra_mmc.h
index c2d52b297743..23f90e300b2a 100644
@@ -1,11 +1,12 @@
 /*
  * Copyright (c) 2011, Google Inc. All rights reserved.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _TEGRA_MMC_H_
-#define _TEGRA_MMC_H_
+#ifndef _MACH_TEGRA_MMC_H_
+#define _MACH_TEGRA_MMC_H_
 
 void tegra_mmc_init(void);
 
-#endif /* _TEGRA_MMC_H_ */
+#endif
drivers/mmc/tegra_mmc.c +2 -2
index 12b14fc35d08..6e1667b3bce7 100644
@@ -10,12 +10,12 @@
 #include <bouncebuf.h>
 #include <common.h>
 #include <fdtdec.h>
+#include <mmc.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/mmc.h>
-#include <mmc.h>
+#include <mach/tegra_mmc.h>
 #include "tegra_mmc_priv.h"
 
 DECLARE_GLOBAL_DATA_PTR;
Signature · 1 line
2.8.1
#29 lore raw

PATCH 4/60 mmc: tegra: move public header to arch/arm/mach-tegra/include

Quoted 6 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Machine-specific headers should be in this location. Eventually, we'll move all headers from arch/arm/include to arch/arm/mach-tegra/include, or find a way to delete them.

Quoted 7 lines
---
 arch/arm/mach-tegra/board2.c                                       | 2 +-
 .../asm/arch-tegra/mmc.h => mach-tegra/include/mach/tegra_mmc.h}   | 7 ++++---
 drivers/mmc/tegra_mmc.c                                            | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)
 rename arch/arm/{include/asm/arch-tegra/mmc.h => mach-tegra/include/mach/tegra_mmc.h} (50%)
#30 lore raw

PATCH 5/60 pwm: tegra: move header file to driver directory

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's pwm.h only contains private definitions for use inside the Tegra PWM driver. Move it out of the global include directory since nothing needs to access it there.

---
 arch/arm/include/asm/arch-tegra124/pwm.h                   | 14 --------------
 arch/arm/include/asm/arch-tegra20/pwm.h                    | 14 --------------
 drivers/pwm/tegra_pwm.c                                    |  3 ++-
 .../asm/arch-tegra/pwm.h => drivers/pwm/tegra_pwm_priv.h   |  6 +++---
 drivers/video/tegra.c                                      |  1 -
 drivers/video/tegra124/display.c                           |  2 +-
 6 files changed, 6 insertions(+), 34 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra124/pwm.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/pwm.h
 rename arch/arm/include/asm/arch-tegra/pwm.h => drivers/pwm/tegra_pwm_priv.h (86%)
arch/arm/include/asm/arch-tegra124/pwm.h deleted +0 -14
deleted file mode 100644
index 3d2c4324dc1d..000000000000
@@ -1,14 +0,0 @@
-/*
- * Tegra pulse width frequency modulator definitions
- *
- * Copyright (c) 2011 The Chromium OS Authors.
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef __ASM_ARCH_TEGRA124_PWM_H
-#define __ASM_ARCH_TEGRA124_PWM_H
-
-#include <asm/arch-tegra/pwm.h>
-
-#endif	/* __ASM_ARCH_TEGRA124_PWM_H */
arch/arm/include/asm/arch-tegra20/pwm.h deleted +0 -14
deleted file mode 100644
index 2207d9cd4d74..000000000000
@@ -1,14 +0,0 @@
-/*
- * Tegra pulse width frequency modulator definitions
- *
- * Copyright (c) 2011 The Chromium OS Authors.
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef __ASM_ARCH_TEGRA20_PWM_H
-#define __ASM_ARCH_TEGRA20_PWM_H
-
-#include <asm/arch-tegra/pwm.h>
-
-#endif	/* __ASM_ARCH_TEGRA20_PWM_H */
drivers/pwm/tegra_pwm.c +2 -1
index 10e1fdc9b562..a0f204a216de 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright 2016 Google Inc.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
@@ -9,7 +10,7 @@
 #include <pwm.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/pwm.h>
+#include "tegra_pwm_priv.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/pwm/tegra_pwm_priv.h renamed from arch/arm/include/asm/arch-tegra/pwm.h +3 -3
similarity index 86%
rename from arch/arm/include/asm/arch-tegra/pwm.h
rename to drivers/pwm/tegra_pwm_priv.h
index b69c0b041f40..25943494fb5c 100644
@@ -7,8 +7,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef __ASM_ARCH_TEGRA_PWM_H
-#define __ASM_ARCH_TEGRA_PWM_H
+#ifndef _TEGRA_PWM_PRIV_H
+#define _TEGRA_PWM_PRIV_H
 
 /* This is a single PWM channel */
 struct pwm_ctlr {
@@ -26,4 +26,4 @@ struct pwm_ctlr {
 #define PWM_DIVIDER_SHIFT	0
 #define PWM_DIVIDER_MASK	(0x1FFF << PWM_DIVIDER_SHIFT)
 
-#endif	/* __ASM_ARCH_TEGRA_PWM_H */
+#endif
drivers/video/tegra.c +0 -1
index 13b10645478e..b4c83b674147 100644
@@ -17,7 +17,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/pwm.h>
 #include <asm/arch/display.h>
 
 DECLARE_GLOBAL_DATA_PTR;
drivers/video/tegra124/display.c +1 -1
index 2f1f0df20eb1..d627285b8081 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright 2014 Google Inc.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:     GPL-2.0+
  *
@@ -18,7 +19,6 @@
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/pwm.h>
 #include <asm/arch-tegra/dc.h>
 #include <dm/uclass-internal.h>
 #include "displayport.h"
Signature · 1 line
2.8.1
#31 lore raw

PATCH 5/60 pwm: tegra: move header file to driver directory

Quoted 7 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's pwm.h only contains private definitions for use inside the Tegra PWM driver. Move it out of the global include directory since nothing needs to access it there.

Quoted 11 lines
---
 arch/arm/include/asm/arch-tegra124/pwm.h                   | 14 --------------
 arch/arm/include/asm/arch-tegra20/pwm.h                    | 14 --------------
 drivers/pwm/tegra_pwm.c                                    |  3 ++-
 .../asm/arch-tegra/pwm.h => drivers/pwm/tegra_pwm_priv.h   |  6 +++---
 drivers/video/tegra.c                                      |  1 -
 drivers/video/tegra124/display.c                           |  2 +-
 6 files changed, 6 insertions(+), 34 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra124/pwm.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/pwm.h
 rename arch/arm/include/asm/arch-tegra/pwm.h => drivers/pwm/tegra_pwm_priv.h (86%)
#32 lore raw

PATCH 5/60 pwm: tegra: move header file to driver directory

In reply to Stephen Warren

Dear Stephen,

Quoted 4 lines · In message <[email protected]> you wrote:

Tegra's pwm.h only contains private definitions for use inside the Tegra PWM driver. Move it out of the global include directory since nothing needs to access it there.

If I understand correctly, all this is just a reorganisation of code. There is no new code or functionality added, right?

Quoted 4 lines

-/*
- * Tegra pulse width frequency modulator definitions
- *
- * Copyright (c) 2011 The Chromium OS Authors.

...

Quoted 4 lines

-/*
- * Tegra pulse width frequency modulator definitions
- *
- * Copyright (c) 2011 The Chromium OS Authors.

...

Quoted 3 lines

/*
* Copyright 2016 Google Inc.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.

...

But then, you drop the original copyright notices of the Chromium project, and replace it by a Nvidia note, and even with this exasperating "All rights reserved" note.

Sorry, but this seems politically incorrect to me.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The connection between the language in which we think/program and the
problems and solutions we can imagine is very close. For this  reason
restricting  language  features  with  the intent of eliminating pro-
grammer errors is at best dangerous.
               - Bjarne Stroustrup in "The  C++ Programming Language"
#33 lore raw

PATCH 5/60 pwm: tegra: move header file to driver directory

Quoted 10 lines · Wolfgang Denk

Dear Stephen,

Quoted 4 lines · In message <[email protected]> you wrote:

Tegra's pwm.h only contains private definitions for use inside the Tegra PWM driver. Move it out of the global include directory since nothing needs to access it there.

If I understand correctly, all this is just a reorganisation of code. There is no new code or functionality added, right?

That's true in this patch, certainly.

Quoted 12 lines
Quoted 4 lines

-/*
- * Tegra pulse width frequency modulator definitions
- *
- * Copyright (c) 2011 The Chromium OS Authors.

...

Quoted 4 lines

-/*
- * Tegra pulse width frequency modulator definitions
- *
- * Copyright (c) 2011 The Chromium OS Authors.

...

Quoted 8 lines
Quoted 3 lines

/*
* Copyright 2016 Google Inc.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.

...

But then, you drop the original copyright notices of the Chromium project,

Those copyright messages were deleted because those files were deleted. In this case (this patch) at least, those files contained nothing but a #include for other files.

For files that were moved (e.g. arch/arm/include/asm/arch-tegra/pwm.h in this patch), all original copyright messages (in this case, both Chromium OS and NVIDIA) were maintained.

I'm not aware of any deletions of copyright messages in files that were not completely deleted, or where the same content was moved elsewhere. If you find any, it was a simple oversight.

#34 lore raw

PATCH 6/60 i2c: tegra: move header file to driver directory

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

tegra_i2c.h contains primarily private definitions for use inside the I2C driver. Move those out of the global include directory since nothing should need to access them.

The Tegra I2C driver exports a Tegra-specific API. Move its prototype into a <mach/*> header. Hopefully one day this will go away.

Tegra's SPL doesn't (yet?) support the full I2C driver stack. However, SPL must make some I2C accesses to program the PMIC to boot the main CPU complex (note that Tegra's SPL runs on a different CPU). Share the implementation of those functions in a new file. This isolates the hacky use of private register definitions to a single file.

---
 arch/arm/mach-tegra/Makefile                       |  3 ++-
 arch/arm/mach-tegra/i2c_early.c                    | 28 ++++++++++++++++++++++
 arch/arm/mach-tegra/include/mach/tegra_i2c.h       | 25 +++++++++++++++++++
 arch/arm/mach-tegra/tegra20/pmu.c                  |  2 +-
 arch/arm/mach-tegra/tegra30/cpu.c                  | 19 ++-------------
 board/nvidia/venice2/as3722_init.c                 | 20 ++--------------
 drivers/i2c/tegra_i2c.c                            |  3 ++-
 .../tegra_i2c.h => drivers/i2c/tegra_i2c_priv.h    | 13 +++-------
 8 files changed, 65 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/mach-tegra/i2c_early.c
 create mode 100644 arch/arm/mach-tegra/include/mach/tegra_i2c.h
 rename arch/arm/include/asm/arch-tegra/tegra_i2c.h => drivers/i2c/tegra_i2c_priv.h (95%)
arch/arm/mach-tegra/Makefile +2 -1
index b2dbc6999c71..197bdfeadd57 100644
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2010-2015 Nvidia Corporation.
+# (C) Copyright 2010-2016 Nvidia Corporation.
 #
 # (C) Copyright 2000-2008
 # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -26,6 +26,7 @@ obj-y += xusb-padctl-dummy.o
 obj-$(CONFIG_DISPLAY_CPUINFO) += sys_info.o
 obj-$(CONFIG_TEGRA_GPU) += gpu.o
 obj-$(CONFIG_TEGRA_CLOCK_SCALING) += emc.o
+obj-$(CONFIG_SPL_BUILD) += i2c_early.o
 
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_ARMV7_PSCI) += psci.o
arch/arm/mach-tegra/i2c_early.c new file +28 -0
new file mode 100644
index 000000000000..dcdd86cef71e
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2010-2016 NVIDIA Corporation
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <mach/tegra_i2c.h>
+#include "../../../drivers/i2c/tegra_i2c_priv.h"
+
+void tegra_i2c_ll_write_addr(uint addr, uint config)
+{
+	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
+
+	writel(addr, &reg->cmd_addr0);
+	writel(config, &reg->cnfg);
+}
+
+void tegra_i2c_ll_write_data(uint data, uint config)
+{
+	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
+
+	writel(data, &reg->cmd_data1);
+	writel(config, &reg->cnfg);
+}
arch/arm/mach-tegra/include/mach/tegra_i2c.h new file +25 -0
new file mode 100644
index 000000000000..57837885176a
@@ -0,0 +1,25 @@
+/*
+ * NVIDIA Tegra I2C controller custom API
+ *
+ * Copyright 2010-2016 NVIDIA Corporation
+ *
+ * SPDX-License-Identifier:	GPL-2.0
+ */
+
+#ifndef _MACH_TEGRA_I2C_H_
+#define _MACH_TEGRA_I2C_H_
+
+struct udevice;
+
+/* Custom APIs for very early I2C access */
+void tegra_i2c_ll_write_addr(uint addr, uint config);
+void tegra_i2c_ll_write_data(uint data, uint config);
+
+/**
+ * Returns the bus number of the DVC controller
+ *
+ * @return number of bus, or -1 if there is no DVC active
+ */
+int tegra_i2c_get_dvc_bus(struct udevice **busp);
+
+#endif
arch/arm/mach-tegra/tegra20/pmu.c +1 -1
index 0da704cd4f3c..8488d97d5cde 100644
@@ -10,8 +10,8 @@
 #include <tps6586x.h>
 #include <asm/io.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/tegra_i2c.h>
 #include <asm/arch-tegra/sys_proto.h>
+#include <mach/tegra_i2c.h>
 #include "../cpu.h"
 
 #define VDD_CORE_NOMINAL_T25	0x17	/* 1.3v */
arch/arm/mach-tegra/tegra30/cpu.c +2 -17
index 66b021b82459..774207354064 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -11,25 +11,10 @@
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
-#include <asm/arch-tegra/tegra_i2c.h>
+#include <mach/tegra_i2c.h>
 #include "../cpu.h"
 
 /* Tegra30-specific CPU init code */
-void tegra_i2c_ll_write_addr(uint addr, uint config)
-{
-	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
-
-	writel(addr, &reg->cmd_addr0);
-	writel(config, &reg->cnfg);
-}
-
-void tegra_i2c_ll_write_data(uint data, uint config)
-{
-	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
-
-	writel(data, &reg->cmd_data1);
-	writel(config, &reg->cnfg);
-}
 
 #define TPS62366A_I2C_ADDR		0xC0
 #define TPS62366A_SET1_REG		0x01
board/nvidia/venice2/as3722_init.c +2 -18
index 960fea7ee7e3..86b164db3be1 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -7,27 +7,11 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch-tegra/tegra_i2c.h>
+#include <mach/tegra_i2c.h>
 #include "as3722_init.h"
 
 /* AS3722-PMIC-specific early init code - get CPU rails up, etc */
 
-void tegra_i2c_ll_write_addr(uint addr, uint config)
-{
-	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
-
-	writel(addr, &reg->cmd_addr0);
-	writel(config, &reg->cnfg);
-}
-
-void tegra_i2c_ll_write_data(uint data, uint config)
-{
-	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
-
-	writel(data, &reg->cmd_data1);
-	writel(config, &reg->cnfg);
-}
-
 void pmic_enable_cpu_vdd(void)
 {
 	debug("%s entry\n", __func__);
drivers/i2c/tegra_i2c.c +2 -1
index 0735ea0b2b12..2a8ab2d5e0b9 100644
@@ -17,7 +17,8 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/tegra_i2c.h>
+#include <mach/tegra_i2c.h>
+#include "tegra_i2c_priv.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/i2c/tegra_i2c_priv.h renamed from arch/arm/include/asm/arch-tegra/tegra_i2c.h +3 -10
similarity index 95%
rename from arch/arm/include/asm/arch-tegra/tegra_i2c.h
rename to drivers/i2c/tegra_i2c_priv.h
index eb83af89f7f5..95c73293d341 100644
@@ -6,8 +6,8 @@
  * SPDX-License-Identifier:	GPL-2.0
  */
 
-#ifndef _TEGRA_I2C_H_
-#define _TEGRA_I2C_H_
+#ifndef _TEGRA_I2C_PRIV_H
+#define _TEGRA_I2C_PRIV_H
 
 #include <asm/types.h>
 
@@ -139,11 +139,4 @@ struct i2c_ctlr {
 /* I2C_CLK_DIVISOR_REGISTER */
 #define CLK_MULT_STD_FAST_MODE		8
 
-/**
- * Returns the bus number of the DVC controller
- *
- * @return number of bus, or -1 if there is no DVC active
- */
-int tegra_i2c_get_dvc_bus(struct udevice **busp);
-
-#endif	/* _TEGRA_I2C_H_ */
+#endif
Signature · 1 line
2.8.1
#35 lore raw

PATCH 6/60 i2c: tegra: move header file to driver directory

Hello Stephen,

Am 19.04.2016 um 22:58 schrieb Stephen Warren:

Quoted 26 lines

From: Stephen Warren <[email protected]>

tegra_i2c.h contains primarily private definitions for use inside the I2C driver. Move those out of the global include directory since nothing should need to access them.

The Tegra I2C driver exports a Tegra-specific API. Move its prototype into a <mach/*> header. Hopefully one day this will go away.

Tegra's SPL doesn't (yet?) support the full I2C driver stack. However, SPL must make some I2C accesses to program the PMIC to boot the main CPU complex (note that Tegra's SPL runs on a different CPU). Share the implementation of those functions in a new file. This isolates the hacky use of private register definitions to a single file.

---
  arch/arm/mach-tegra/Makefile                       |  3 ++-
  arch/arm/mach-tegra/i2c_early.c                    | 28 ++++++++++++++++++++++
  arch/arm/mach-tegra/include/mach/tegra_i2c.h       | 25 +++++++++++++++++++
  arch/arm/mach-tegra/tegra20/pmu.c                  |  2 +-
  arch/arm/mach-tegra/tegra30/cpu.c                  | 19 ++-------------
  board/nvidia/venice2/as3722_init.c                 | 20 ++--------------
  drivers/i2c/tegra_i2c.c                            |  3 ++-
  .../tegra_i2c.h => drivers/i2c/tegra_i2c_priv.h    | 13 +++-------
  8 files changed, 65 insertions(+), 48 deletions(-)
Quoted 3 lines

create mode 100644 arch/arm/mach-tegra/i2c_early.c
create mode 100644 arch/arm/mach-tegra/include/mach/tegra_i2c.h
rename arch/arm/include/asm/arch-tegra/tegra_i2c.h => drivers/i2c/tegra_i2c_priv.h (95%)

Thanks!

bye,
Heiko

Quoted 223 lines
arch/arm/mach-tegra/Makefile +2 -1
index b2dbc6999c71..197bdfeadd57 100644
@@ -1,5 +1,5 @@
  #
-# (C) Copyright 2010-2015 Nvidia Corporation.
+# (C) Copyright 2010-2016 Nvidia Corporation.
  #
  # (C) Copyright 2000-2008
  # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -26,6 +26,7 @@ obj-y += xusb-padctl-dummy.o
  obj-$(CONFIG_DISPLAY_CPUINFO) += sys_info.o
  obj-$(CONFIG_TEGRA_GPU) += gpu.o
  obj-$(CONFIG_TEGRA_CLOCK_SCALING) += emc.o
+obj-$(CONFIG_SPL_BUILD) += i2c_early.o
 
  ifndef CONFIG_SPL_BUILD
  obj-$(CONFIG_ARMV7_PSCI) += psci.o
arch/arm/mach-tegra/i2c_early.c new file +28 -0
new file mode 100644
index 000000000000..dcdd86cef71e
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2010-2016 NVIDIA Corporation
+ * NVIDIA Corporation <www.nvidia.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <mach/tegra_i2c.h>
+#include "../../../drivers/i2c/tegra_i2c_priv.h"
+
+void tegra_i2c_ll_write_addr(uint addr, uint config)
+{
+	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
+
+	writel(addr, &reg->cmd_addr0);
+	writel(config, &reg->cnfg);
+}
+
+void tegra_i2c_ll_write_data(uint data, uint config)
+{
+	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
+
+	writel(data, &reg->cmd_data1);
+	writel(config, &reg->cnfg);
+}
arch/arm/mach-tegra/include/mach/tegra_i2c.h new file +25 -0
new file mode 100644
index 000000000000..57837885176a
@@ -0,0 +1,25 @@
+/*
+ * NVIDIA Tegra I2C controller custom API
+ *
+ * Copyright 2010-2016 NVIDIA Corporation
+ *
+ * SPDX-License-Identifier:	GPL-2.0
+ */
+
+#ifndef _MACH_TEGRA_I2C_H_
+#define _MACH_TEGRA_I2C_H_
+
+struct udevice;
+
+/* Custom APIs for very early I2C access */
+void tegra_i2c_ll_write_addr(uint addr, uint config);
+void tegra_i2c_ll_write_data(uint data, uint config);
+
+/**
+ * Returns the bus number of the DVC controller
+ *
+ * @return number of bus, or -1 if there is no DVC active
+ */
+int tegra_i2c_get_dvc_bus(struct udevice **busp);
+
+#endif
arch/arm/mach-tegra/tegra20/pmu.c +1 -1
index 0da704cd4f3c..8488d97d5cde 100644
@@ -10,8 +10,8 @@
  #include <tps6586x.h>
  #include <asm/io.h>
  #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/tegra_i2c.h>
  #include <asm/arch-tegra/sys_proto.h>
+#include <mach/tegra_i2c.h>
  #include "../cpu.h"
 
  #define VDD_CORE_NOMINAL_T25	0x17	/* 1.3v */
arch/arm/mach-tegra/tegra30/cpu.c +2 -17
index 66b021b82459..774207354064 100644
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2010-2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
   *
   * SPDX-License-Identifier:	GPL-2.0
   */
@@ -11,25 +11,10 @@
  #include <asm/arch/tegra.h>
  #include <asm/arch-tegra/clk_rst.h>
  #include <asm/arch-tegra/pmc.h>
-#include <asm/arch-tegra/tegra_i2c.h>
+#include <mach/tegra_i2c.h>
  #include "../cpu.h"
 
  /* Tegra30-specific CPU init code */
-void tegra_i2c_ll_write_addr(uint addr, uint config)
-{
-	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
-
-	writel(addr, &reg->cmd_addr0);
-	writel(config, &reg->cnfg);
-}
-
-void tegra_i2c_ll_write_data(uint data, uint config)
-{
-	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
-
-	writel(data, &reg->cmd_data1);
-	writel(config, &reg->cnfg);
-}
 
  #define TPS62366A_I2C_ADDR		0xC0
  #define TPS62366A_SET1_REG		0x01
board/nvidia/venice2/as3722_init.c +2 -18
index 960fea7ee7e3..86b164db3be1 100644
@@ -1,5 +1,5 @@
  /*
- * (C) Copyright 2013
+ * (C) Copyright 2013-2016
   * NVIDIA Corporation <www.nvidia.com>
   *
   * SPDX-License-Identifier:     GPL-2.0+
@@ -7,27 +7,11 @@
 
  #include <common.h>
  #include <asm/io.h>
-#include <asm/arch-tegra/tegra_i2c.h>
+#include <mach/tegra_i2c.h>
  #include "as3722_init.h"
 
  /* AS3722-PMIC-specific early init code - get CPU rails up, etc */
 
-void tegra_i2c_ll_write_addr(uint addr, uint config)
-{
-	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
-
-	writel(addr, &reg->cmd_addr0);
-	writel(config, &reg->cnfg);
-}
-
-void tegra_i2c_ll_write_data(uint data, uint config)
-{
-	struct i2c_ctlr *reg = (struct i2c_ctlr *)TEGRA_DVC_BASE;
-
-	writel(data, &reg->cmd_data1);
-	writel(config, &reg->cnfg);
-}
-
  void pmic_enable_cpu_vdd(void)
  {
  	debug("%s entry\n", __func__);
drivers/i2c/tegra_i2c.c +2 -1
index 0735ea0b2b12..2a8ab2d5e0b9 100644
@@ -17,7 +17,8 @@
  #include <asm/arch/gpio.h>
  #include <asm/arch/pinmux.h>
  #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/tegra_i2c.h>
+#include <mach/tegra_i2c.h>
+#include "tegra_i2c_priv.h"
 
  DECLARE_GLOBAL_DATA_PTR;
 
drivers/i2c/tegra_i2c_priv.h renamed from arch/arm/include/asm/arch-tegra/tegra_i2c.h +3 -10
similarity index 95%
rename from arch/arm/include/asm/arch-tegra/tegra_i2c.h
rename to drivers/i2c/tegra_i2c_priv.h
index eb83af89f7f5..95c73293d341 100644
@@ -6,8 +6,8 @@
   * SPDX-License-Identifier:	GPL-2.0
   */
 
-#ifndef _TEGRA_I2C_H_
-#define _TEGRA_I2C_H_
+#ifndef _TEGRA_I2C_PRIV_H
+#define _TEGRA_I2C_PRIV_H
 
  #include <asm/types.h>
 
@@ -139,11 +139,4 @@ struct i2c_ctlr {
  /* I2C_CLK_DIVISOR_REGISTER */
  #define CLK_MULT_STD_FAST_MODE		8
 
-/**
- * Returns the bus number of the DVC controller
- *
- * @return number of bus, or -1 if there is no DVC active
- */
-int tegra_i2c_get_dvc_bus(struct udevice **busp);
-
-#endif	/* _TEGRA_I2C_H_ */
+#endif
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#36 lore raw

PATCH 6/60 i2c: tegra: move header file to driver directory

In reply to Stephen Warren
Quoted 16 lines · Stephen Warren

From: Stephen Warren <[email protected]>

tegra_i2c.h contains primarily private definitions for use inside the I2C driver. Move those out of the global include directory since nothing should need to access them.

The Tegra I2C driver exports a Tegra-specific API. Move its prototype into a <mach/*> header. Hopefully one day this will go away.

Tegra's SPL doesn't (yet?) support the full I2C driver stack. However, SPL must make some I2C accesses to program the PMIC to boot the main CPU complex (note that Tegra's SPL runs on a different CPU). Share the implementation of those functions in a new file. This isolates the hacky use of private register definitions to a single file.

Quoted 13 lines
---
 arch/arm/mach-tegra/Makefile                       |  3 ++-
 arch/arm/mach-tegra/i2c_early.c                    | 28 ++++++++++++++++++++++
 arch/arm/mach-tegra/include/mach/tegra_i2c.h       | 25 +++++++++++++++++++
 arch/arm/mach-tegra/tegra20/pmu.c                  |  2 +-
 arch/arm/mach-tegra/tegra30/cpu.c                  | 19 ++-------------
 board/nvidia/venice2/as3722_init.c                 | 20 ++--------------
 drivers/i2c/tegra_i2c.c                            |  3 ++-
 .../tegra_i2c.h => drivers/i2c/tegra_i2c_priv.h    | 13 +++-------
 8 files changed, 65 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/mach-tegra/i2c_early.c
 create mode 100644 arch/arm/mach-tegra/include/mach/tegra_i2c.h
 rename arch/arm/include/asm/arch-tegra/tegra_i2c.h => drivers/i2c/tegra_i2c_priv.h (95%)
#37 lore raw

PATCH 7/60 usb: tegra: move header file to driver directory

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's usb.h only contains private definitions for use inside the Tegra EHCI driver. Move it out of the global include directory since nothing should need to access them.

One access to these registers does exist; a boot-time cleanup of any previous USB device-mode session. Hopefully this can be moved into the EHCI controller probe/bind at some point, presuming that USB devices get probed/bound at boot even before USB is used.

---
 arch/arm/mach-tegra/board2.c                                        | 2 +-
 .../asm/arch-tegra/usb.h => drivers/usb/host/ehci-tegra-priv.h      | 6 +++---
 drivers/usb/host/ehci-tegra.c                                       | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
 rename arch/arm/include/asm/arch-tegra/usb.h => drivers/usb/host/ehci-tegra-priv.h (99%)
arch/arm/mach-tegra/board2.c +1 -1
index 05e83268cd40..3ee65ee3f921 100644
@@ -26,7 +26,7 @@
 #ifdef CONFIG_TEGRA_CLOCK_SCALING
 #include <asm/arch/emc.h>
 #endif
-#include <asm/arch-tegra/usb.h>
+#include "../../../drivers/usb/host/ehci-tegra-priv.h"
 #ifdef CONFIG_USB_EHCI_TEGRA
 #include <usb.h>
 #endif
drivers/usb/host/ehci-tegra-priv.h renamed from arch/arm/include/asm/arch-tegra/usb.h +3 -3
similarity index 99%
rename from arch/arm/include/asm/arch-tegra/usb.h
rename to drivers/usb/host/ehci-tegra-priv.h
index 24198e4a33d0..72d8a1a7eb9c 100644
@@ -5,8 +5,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _TEGRA_USB_H_
-#define _TEGRA_USB_H_
+#ifndef _EHCI_TEGRA_PRIV_H
+#define _EHCI_TEGRA_PRIV_H
 
 /* USB Controller (USBx_CONTROLLER_) regs */
 struct usb_ctlr {
@@ -355,4 +355,4 @@ struct usb_ctlr {
 #define VBUS_B_SESS_VLD_SW_VALUE	(1 << 12)
 #define VBUS_B_SESS_VLD_SW_EN		(1 << 11)
 
-#endif	/* _TEGRA_USB_H_ */
+#endif
drivers/usb/host/ehci-tegra.c +2 -2
index 31d54ab285bf..9bf069382605 100644
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * Copyright (c) 2009-2015 NVIDIA Corporation
+ * Copyright (c) 2009-2016 NVIDIA Corporation
  * Copyright (c) 2013 Lucas Stach
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -12,7 +12,6 @@
 #include <asm/io.h>
 #include <asm-generic/gpio.h>
 #include <asm/arch/clock.h>
-#include <asm/arch-tegra/usb.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <usb.h>
 #include <usb/ulpi.h>
@@ -20,6 +19,7 @@
 #include <fdtdec.h>
 
 #include "ehci.h"
+#include "ehci-tegra-priv.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
Signature · 1 line
2.8.1
#38 lore raw

PATCH 7/60 usb: tegra: move header file to driver directory

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's usb.h only contains private definitions for use inside the Tegra EHCI driver. Move it out of the global include directory since nothing should need to access them.

One access to these registers does exist; a boot-time cleanup of any previous USB device-mode session. Hopefully this can be moved into the EHCI controller probe/bind at some point, presuming that USB devices get probed/bound at boot even before USB is used.

Quoted 7 lines
---
 arch/arm/mach-tegra/board2.c                                        | 2 +-
 .../asm/arch-tegra/usb.h => drivers/usb/host/ehci-tegra-priv.h      | 6 +++---
 drivers/usb/host/ehci-tegra.c                                       | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
 rename arch/arm/include/asm/arch-tegra/usb.h => drivers/usb/host/ehci-tegra-priv.h (99%)
#39 lore raw

PATCH 8/60 video: tegra: move header file to driver directory

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's dc.h/display.h only contain private definitions for use inside the Tegra display driver. Move them out of the global include directory since nothing needs to access it there. Since they both describe DC registers, combine then into a single header.

---
 arch/arm/include/asm/arch-tegra20/display.h        | 29 ---------------------
 arch/arm/mach-tegra/tegra20/display.c              | 15 -----------
 drivers/video/tegra.c                              |  3 +--
 drivers/video/tegra124/display.c                   |  2 +-
 drivers/video/tegra124/dp.c                        |  4 +--
 drivers/video/tegra124/sor.c                       |  4 +--
 .../arch-tegra/dc.h => drivers/video/tegra_dc.h    | 30 +++++++++++++++++++---
 7 files changed, 32 insertions(+), 55 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra20/display.h
 delete mode 100644 arch/arm/mach-tegra/tegra20/display.c
 rename arch/arm/include/asm/arch-tegra/dc.h => drivers/video/tegra_dc.h (94%)
arch/arm/include/asm/arch-tegra20/display.h deleted +0 -29
deleted file mode 100644
index ee5a3f6c91c0..000000000000
@@ -1,29 +0,0 @@
-/*
- *  (C) Copyright 2010
- *  NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef __ASM_ARCH_TEGRA_DISPLAY_H
-#define __ASM_ARCH_TEGRA_DISPLAY_H
-
-#include <asm/arch-tegra/dc.h>
-
-/* This holds information about a window which can be displayed */
-struct disp_ctl_win {
-	enum win_color_depth_id fmt;	/* Color depth/format */
-	unsigned	bpp;		/* Bits per pixel */
-	phys_addr_t	phys_addr;	/* Physical address in memory */
-	unsigned	x;		/* Horizontal address offset (bytes) */
-	unsigned	y;		/* Veritical address offset (bytes) */
-	unsigned	w;		/* Width of source window */
-	unsigned	h;		/* Height of source window */
-	unsigned	stride;		/* Number of bytes per line */
-	unsigned	out_x;		/* Left edge of output window (col) */
-	unsigned	out_y;		/* Top edge of output window (row) */
-	unsigned	out_w;		/* Width of output window in pixels */
-	unsigned	out_h;		/* Height of output window in pixels */
-};
-
-#endif /*__ASM_ARCH_TEGRA_DISPLAY_H*/
arch/arm/mach-tegra/tegra20/display.c deleted +0 -15
deleted file mode 100644
index 52a476eb7d8a..000000000000
@@ -1,15 +0,0 @@
-/*
- * (C) Copyright 2010-2016
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/tegra.h>
-#include <asm/arch/display.h>
-#include <asm/arch-tegra/dc.h>
-#include <asm/arch-tegra/clk_rst.h>
-
drivers/video/tegra.c +1 -2
index b4c83b674147..45a2876d4030 100644
@@ -13,11 +13,10 @@
 #include <asm/system.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
-
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/display.h>
+#include "tegra_dc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/video/tegra124/display.c +1 -1
index d627285b8081..bc31103e8b92 100644
@@ -19,8 +19,8 @@
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch-tegra/dc.h>
 #include <dm/uclass-internal.h>
+#include "../tegra_dc.h"
 #include "displayport.h"
 
 DECLARE_GLOBAL_DATA_PTR;
drivers/video/tegra124/dp.c +2 -2
index 5bf8524a5e8a..4e97b6de276a 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2013, NVIDIA Corporation.
+ * Copyright (c) 2011-2016, NVIDIA Corporation.
  * Copyright 2014 Google Inc.
  *
  * SPDX-License-Identifier:     GPL-2.0
@@ -13,7 +13,7 @@
 #include <fdtdec.h>
 #include <video_bridge.h>
 #include <asm/io.h>
-#include <asm/arch-tegra/dc.h>
+#include "../tegra_dc.h"
 #include "display.h"
 #include "edid.h"
 #include "sor.h"
drivers/video/tegra124/sor.c +2 -2
index e5cea51d48c8..40d9dd22a2c4 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2013, NVIDIA Corporation.
+ * Copyright (c) 2011-2016, NVIDIA Corporation.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -13,7 +13,7 @@
 #include <video_bridge.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch-tegra/dc.h>
+#include "../tegra_dc.h"
 #include "displayport.h"
 #include "sor.h"
 
drivers/video/tegra_dc.h renamed from arch/arm/include/asm/arch-tegra/dc.h +26 -4
similarity index 94%
rename from arch/arm/include/asm/arch-tegra/dc.h
rename to drivers/video/tegra_dc.h
index 3a7ee5e77baf..77ff2122de3c 100644
@@ -1,12 +1,12 @@
 /*
- *  (C) Copyright 2010
+ *  (C) Copyright 2010-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef __ASM_ARCH_TEGRA_DC_H
-#define __ASM_ARCH_TEGRA_DC_H
+#ifndef _VIDEO_TEGRA_DC_H
+#define _VIDEO_TEGRA_DC_H
 
 /* Register definitions for the Tegra display controller */
 
@@ -566,4 +566,26 @@ enum {
 #define DC_N_WINDOWS			5
 #define DC_REG_SAVE_SPACE		(DC_N_WINDOWS + 5)
 
-#endif /* __ASM_ARCH_TEGRA_DC_H */
+#ifdef CONFIG_TEGRA20
+/*
+ * I am not sure if this structure actually only applies to Tegra20, or simply
+ * was only in <arch-tegra20/display.h> and nowhere else for no good reason.
+ */
+/* This holds information about a window which can be displayed */
+struct disp_ctl_win {
+	enum win_color_depth_id fmt;	/* Color depth/format */
+	unsigned	bpp;		/* Bits per pixel */
+	phys_addr_t	phys_addr;	/* Physical address in memory */
+	unsigned	x;		/* Horizontal address offset (bytes) */
+	unsigned	y;		/* Veritical address offset (bytes) */
+	unsigned	w;		/* Width of source window */
+	unsigned	h;		/* Height of source window */
+	unsigned	stride;		/* Number of bytes per line */
+	unsigned	out_x;		/* Left edge of output window (col) */
+	unsigned	out_y;		/* Top edge of output window (row) */
+	unsigned	out_w;		/* Width of output window in pixels */
+	unsigned	out_h;		/* Height of output window in pixels */
+};
+#endif
+
+#endif
Signature · 1 line
2.8.1
#40 lore raw

PATCH 8/60 video: tegra: move header file to driver directory

Quoted 8 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's dc.h/display.h only contain private definitions for use inside the Tegra display driver. Move them out of the global include directory since nothing needs to access it there. Since they both describe DC registers, combine then into a single header.

Quoted 12 lines
---
 arch/arm/include/asm/arch-tegra20/display.h        | 29 ---------------------
 arch/arm/mach-tegra/tegra20/display.c              | 15 -----------
 drivers/video/tegra.c                              |  3 +--
 drivers/video/tegra124/display.c                   |  2 +-
 drivers/video/tegra124/dp.c                        |  4 +--
 drivers/video/tegra124/sor.c                       |  4 +--
 .../arch-tegra/dc.h => drivers/video/tegra_dc.h    | 30 +++++++++++++++++++---
 7 files changed, 32 insertions(+), 55 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra20/display.h
 delete mode 100644 arch/arm/mach-tegra/tegra20/display.c
 rename arch/arm/include/asm/arch-tegra/dc.h => drivers/video/tegra_dc.h (94%)
#41 lore raw

PATCH 9/60 ARM: tegra: correct 64-bit DT unit addresses

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

In most current Tegra DT files, 64-bit addresses are represented in unit addresses as a pair of comma-separated 32-bit values. Apparently this isn't the correct representation for simple busses, and the unit address should be represented as a single 64-bit value. Update U-Boot's DTs to fix this issue.

---
 arch/arm/dts/tegra124-nyan-big.dts   |  8 +++---
 arch/arm/dts/tegra124-nyan.dtsi      |  4 +--
 arch/arm/dts/tegra210-e2220-1170.dts | 16 +++++------
 arch/arm/dts/tegra210-p2371-0000.dts | 16 +++++------
 arch/arm/dts/tegra210-p2371-2180.dts | 20 +++++++-------
 arch/arm/dts/tegra210-p2571.dts      | 48 ++++++++++++++++-----------------
 arch/arm/dts/tegra210.dtsi           | 52 ++++++++++++++++++------------------
 7 files changed, 82 insertions(+), 82 deletions(-)
arch/arm/dts/tegra124-nyan-big.dts +4 -4
index 20e0be30e980..75821fcda647 100644
@@ -15,8 +15,8 @@
 		i2c3 = "/i2c at 7000c500";
 		i2c4 = "/i2c at 7000c700";
 		i2c5 = "/i2c at 7000d100";
-		rtc0 = "/i2c at 0,7000d000/pmic at 40";
-		rtc1 = "/rtc at 0,7000e000";
+		rtc0 = "/i2c at 7000d000/pmic at 40";
+		rtc1 = "/rtc at 7000e000";
 		sdhci0 = "/sdhci at 700b0600";
 		sdhci1 = "/sdhci at 700b0400";
 		spi0 = "/spi at 7000d400";
@@ -58,7 +58,7 @@
 		ddc-i2c-bus = <&dpaux>;
 	};
 
-	sdhci at 0,700b0400 { /* SD Card on this bus */
+	sdhci at 700b0400 { /* SD Card on this bus */
 		wp-gpios = <&gpio TEGRA_GPIO(Q, 4) GPIO_ACTIVE_LOW>;
 	};
 
@@ -69,7 +69,7 @@
 		nvidia,model = "GoogleNyanBig";
 	};
 
-	pinmux at 0,70000868 {
+	pinmux at 70000868 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinmux_default>;
 
arch/arm/dts/tegra124-nyan.dtsi +2 -2
index 1b6931fae806..780131f7361c 100644
@@ -3,8 +3,8 @@
 
 / {
 	aliases {
-		rtc0 = "/i2c at 0,7000d000/pmic at 40";
-		rtc1 = "/rtc at 0,7000e000";
+		rtc0 = "/i2c at 7000d000/pmic at 40";
+		rtc1 = "/rtc at 7000e000";
 		serial0 = &uarta;
 	};
 
arch/arm/dts/tegra210-e2220-1170.dts +8 -8
index 75efbba1061e..fe27a81e4337 100644
@@ -11,34 +11,34 @@
 	};
 
 	aliases {
-		i2c0 = "/i2c at 0,7000d000";
-		sdhci0 = "/sdhci at 0,700b0600";
-		sdhci1 = "/sdhci at 0,700b0000";
-		usb0 = "/usb at 0,7d000000";
+		i2c0 = "/i2c at 7000d000";
+		sdhci0 = "/sdhci at 700b0600";
+		sdhci1 = "/sdhci at 700b0000";
+		usb0 = "/usb at 7d000000";
 	};
 
 	memory {
 		reg = <0x0 0x80000000 0x0 0xc0000000>;
 	};
 
-	sdhci at 0,700b0000 {
+	sdhci at 700b0000 {
 		status = "okay";
 		cd-gpios = <&gpio TEGRA_GPIO(Z, 1) GPIO_ACTIVE_LOW>;
 		power-gpios = <&gpio TEGRA_GPIO(Z, 4) GPIO_ACTIVE_HIGH>;
 		bus-width = <4>;
 	};
 
-	sdhci at 0,700b0600 {
+	sdhci at 700b0600 {
 		status = "okay";
 		bus-width = <8>;
 	};
 
-	i2c at 0,7000d000 {
+	i2c at 7000d000 {
 		status = "okay";
 		clock-frequency = <400000>;
 	};
 
-	usb at 0,7d000000 {
+	usb at 7d000000 {
 		status = "okay";
 		dr_mode = "peripheral";
 	};
arch/arm/dts/tegra210-p2371-0000.dts +8 -8
index 10172a23ad70..3f0e14d62c2c 100644
@@ -11,34 +11,34 @@
 	};
 
 	aliases {
-		i2c0 = "/i2c at 0,7000d000";
-		sdhci0 = "/sdhci at 0,700b0600";
-		sdhci1 = "/sdhci at 0,700b0000";
-		usb0 = "/usb at 0,7d000000";
+		i2c0 = "/i2c at 7000d000";
+		sdhci0 = "/sdhci at 700b0600";
+		sdhci1 = "/sdhci at 700b0000";
+		usb0 = "/usb at 7d000000";
 	};
 
 	memory {
 		reg = <0x0 0x80000000 0x0 0xc0000000>;
 	};
 
-	sdhci at 0,700b0000 {
+	sdhci at 700b0000 {
 		status = "okay";
 		cd-gpios = <&gpio TEGRA_GPIO(Z, 1) GPIO_ACTIVE_LOW>;
 		power-gpios = <&gpio TEGRA_GPIO(Z, 4) GPIO_ACTIVE_HIGH>;
 		bus-width = <4>;
 	};
 
-	sdhci at 0,700b0600 {
+	sdhci at 700b0600 {
 		status = "okay";
 		bus-width = <8>;
 	};
 
-	i2c at 0,7000d000 {
+	i2c at 7000d000 {
 		status = "okay";
 		clock-frequency = <400000>;
 	};
 
-	usb at 0,7d000000 {
+	usb at 7d000000 {
 		status = "okay";
 		dr_mode = "otg";
 		nvidia,vbus-gpio = <&gpio TEGRA_GPIO(CC, 4) GPIO_ACTIVE_HIGH>;
arch/arm/dts/tegra210-p2371-2180.dts +10 -10
index bf35497d83f7..c1f40e91e318 100644
@@ -11,17 +11,17 @@
 	};
 
 	aliases {
-		i2c0 = "/i2c at 0,7000d000";
-		sdhci0 = "/sdhci at 0,700b0600";
-		sdhci1 = "/sdhci at 0,700b0000";
-		usb0 = "/usb at 0,7d000000";
+		i2c0 = "/i2c at 7000d000";
+		sdhci0 = "/sdhci at 700b0600";
+		sdhci1 = "/sdhci at 700b0000";
+		usb0 = "/usb at 7d000000";
 	};
 
 	memory {
 		reg = <0x0 0x80000000 0x0 0xc0000000>;
 	};
 
-	pcie-controller at 0,01003000 {
+	pcie-controller at 01003000 {
 		status = "okay";
 
 		pci at 1,0 {
@@ -33,7 +33,7 @@
 		};
 	};
 
-	padctl at 0,7009f000 {
+	padctl at 7009f000 {
 		pinctrl-0 = <&padctl_default>;
 		pinctrl-names = "default";
 
@@ -71,7 +71,7 @@
 		};
 	};
 
-	sdhci at 0,700b0000 {
+	sdhci at 700b0000 {
 		status = "okay";
 		cd-gpios = <&gpio TEGRA_GPIO(Z, 1) GPIO_ACTIVE_LOW>;
 		power-gpios = <&gpio TEGRA_GPIO(Z, 3) GPIO_ACTIVE_HIGH>;
@@ -79,17 +79,17 @@
 		bus-width = <4>;
 	};
 
-	sdhci at 0,700b0600 {
+	sdhci at 700b0600 {
 		status = "okay";
 		bus-width = <8>;
 	};
 
-	i2c at 0,7000d000 {
+	i2c at 7000d000 {
 		status = "okay";
 		clock-frequency = <400000>;
 	};
 
-	usb at 0,7d000000 {
+	usb at 7d000000 {
 		status = "okay";
 		dr_mode = "otg";
 		nvidia,vbus-gpio = <&gpio TEGRA_GPIO(CC, 4) GPIO_ACTIVE_HIGH>;
arch/arm/dts/tegra210-p2571.dts +24 -24

106 lines not on this page · raw message

arch/arm/dts/tegra210.dtsi +26 -26

208 lines not on this page · raw message

Signature · 1 line
2.8.1
#42 lore raw

PATCH 9/60 ARM: tegra: correct 64-bit DT unit addresses

Quoted 9 lines · Stephen Warren

From: Stephen Warren <[email protected]>

In most current Tegra DT files, 64-bit addresses are represented in unit addresses as a pair of comma-separated 32-bit values. Apparently this isn't the correct representation for simple busses, and the unit address should be represented as a single 64-bit value. Update U-Boot's DTs to fix this issue.

Quoted 9 lines
---
 arch/arm/dts/tegra124-nyan-big.dts   |  8 +++---
 arch/arm/dts/tegra124-nyan.dtsi      |  4 +--
 arch/arm/dts/tegra210-e2220-1170.dts | 16 +++++------
 arch/arm/dts/tegra210-p2371-0000.dts | 16 +++++------
 arch/arm/dts/tegra210-p2371-2180.dts | 20 +++++++-------
 arch/arm/dts/tegra210-p2571.dts      | 48 ++++++++++++++++-----------------
 arch/arm/dts/tegra210.dtsi           | 52 ++++++++++++++++++------------------
 7 files changed, 82 insertions(+), 82 deletions(-)
#43 lore raw

PATCH 10/60 ARM: tegra: sort DT /aliases entries

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This complies with my OCD.

---
 arch/arm/dts/tegra124-nyan-big.dts   | 2 +-
 arch/arm/dts/tegra20-colibri.dts     | 2 +-
 arch/arm/dts/tegra20-harmony.dts     | 4 ++--
 arch/arm/dts/tegra20-medcom-wide.dts | 2 +-
 arch/arm/dts/tegra20-paz00.dts       | 2 +-
 arch/arm/dts/tegra20-plutux.dts      | 2 +-
 arch/arm/dts/tegra20-seaboard.dts    | 4 ++--
 arch/arm/dts/tegra20-tec.dts         | 2 +-
 arch/arm/dts/tegra20-trimslice.dts   | 4 ++--
 arch/arm/dts/tegra20-ventana.dts     | 2 +-
 arch/arm/dts/tegra20-whistler.dts    | 2 +-
 11 files changed, 14 insertions(+), 14 deletions(-)
arch/arm/dts/tegra124-nyan-big.dts +1 -1
index 75821fcda647..d41c995dcc14 100644
@@ -8,7 +8,6 @@
 
 	aliases {
 		console = &uarta;
-		stdout-path = &uarta;
 		i2c0 = "/i2c at 7000d000";
 		i2c1 = "/i2c at 7000c000";
 		i2c2 = "/i2c at 7000c400";
@@ -17,6 +16,7 @@
 		i2c5 = "/i2c at 7000d100";
 		rtc0 = "/i2c at 7000d000/pmic at 40";
 		rtc1 = "/rtc at 7000e000";
+		stdout-path = &uarta;
 		sdhci0 = "/sdhci at 700b0600";
 		sdhci1 = "/sdhci at 700b0400";
 		spi0 = "/spi at 7000d400";
arch/arm/dts/tegra20-colibri.dts +1 -1
index 2cf24d3ee771..dbbdd59c82a1 100644
@@ -14,10 +14,10 @@
 		i2c0 = "/i2c at 7000d000";
 		i2c1 = "/i2c at 7000c000";
 		i2c2 = "/i2c at 7000c400";
+		sdhci0 = "/sdhci at c8000600";
 		usb0 = "/usb at c5008000";
 		usb1 = "/usb at c5000000";
 		usb2 = "/usb at c5004000";
-		sdhci0 = "/sdhci at c8000600";
 	};
 
 	host1x at 50000000 {
arch/arm/dts/tegra20-harmony.dts +2 -2
index 623eb90a8a00..23dbf2ce79ae 100644
@@ -11,10 +11,10 @@
 	};
 
 	aliases {
-		usb0 = "/usb at c5008000";
-		usb1 = "/usb at c5004000";
 		sdhci0 = "/sdhci at c8000600";
 		sdhci1 = "/sdhci at c8000200";
+		usb0 = "/usb at c5008000";
+		usb1 = "/usb at c5004000";
 	};
 
 	memory {
arch/arm/dts/tegra20-medcom-wide.dts +1 -1
index 3d37257189e0..f016961f0c45 100644
@@ -11,8 +11,8 @@
 	};
 
 	aliases {
-		usb0 = "/usb at c5008000";
 		sdhci0 = "/sdhci at c8000600";
+		usb0 = "/usb at c5008000";
 	};
 
 	memory {
arch/arm/dts/tegra20-paz00.dts +1 -1
index 5c7e80558da3..eb451bef019c 100644
@@ -11,9 +11,9 @@
 	};
 
 	aliases {
-		usb0 = "/usb at c5008000";
 		sdhci0 = "/sdhci at c8000600";
 		sdhci1 = "/sdhci at c8000000";
+		usb0 = "/usb at c5008000";
 	};
 
 	memory {
arch/arm/dts/tegra20-plutux.dts +1 -1
index 7f57f1d4b573..45acd3a35ef7 100644
@@ -11,8 +11,8 @@
 	};
 
 	aliases {
-		usb0 = "/usb at c5008000";
 		sdhci0 = "/sdhci at c8000600";
+		usb0 = "/usb at c5008000";
 	};
 
 	memory {
arch/arm/dts/tegra20-seaboard.dts +2 -2
index eada59073efc..886836bfd41c 100644
@@ -16,14 +16,14 @@
 
 	aliases {
 		/* This defines the order of our ports */
-		usb0 = "/usb at c5008000";
-		usb1 = "/usb at c5000000";
 		i2c0 = "/i2c at 7000d000";
 		i2c1 = "/i2c at 7000c000";
 		i2c2 = "/i2c at 7000c400";
 		i2c3 = "/i2c at 7000c500";
 		sdhci0 = "/sdhci at c8000600";
 		sdhci1 = "/sdhci at c8000400";
+		usb0 = "/usb at c5008000";
+		usb1 = "/usb at c5000000";
 	};
 
 	memory {
arch/arm/dts/tegra20-tec.dts +1 -1
index 4f68077fafa1..830029741797 100644
@@ -11,8 +11,8 @@
 	};
 
 	aliases {
-		usb0 = "/usb at c5008000";
 		sdhci0 = "/sdhci at c8000600";
+		usb0 = "/usb at c5008000";
 	};
 
 	memory {
arch/arm/dts/tegra20-trimslice.dts +2 -2
index db13ff965178..1acdd78b5f33 100644
@@ -11,11 +11,11 @@
 	};
 
 	aliases {
-		usb0 = "/usb at c5008000";
-		usb1 = "/usb at c5000000";
 		sdhci0 = "/sdhci at c8000600";
 		sdhci1 = "/sdhci at c8000000";
 		spi0 = "/spi at 7000c380";
+		usb0 = "/usb at c5008000";
+		usb1 = "/usb at c5000000";
 	};
 
 	memory {
arch/arm/dts/tegra20-ventana.dts +1 -1
index 851e0ed8d9a4..5047d0982ba9 100644
@@ -11,9 +11,9 @@
 	};
 
 	aliases {
-		usb0 = "/usb at c5008000";
 		sdhci0 = "/sdhci at c8000600";
 		sdhci1 = "/sdhci at c8000400";
+		usb0 = "/usb at c5008000";
 	};
 
 	memory {
arch/arm/dts/tegra20-whistler.dts +1 -1
index 358c5824f7cc..fb6a4fcf9133 100644
@@ -12,9 +12,9 @@
 
 	aliases {
 		i2c0 = "/i2c at 7000d000";
-		usb0 = "/usb at c5008000";
 		sdhci0 = "/sdhci at c8000600";
 		sdhci1 = "/sdhci at c8000400";
+		usb0 = "/usb at c5008000";
 	};
 
 	memory {
Signature · 1 line
2.8.1
#44 lore raw

PATCH 10/60 ARM: tegra: sort DT /aliases entries

Quoted 5 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This complies with my OCD.

Quoted 13 lines
---
 arch/arm/dts/tegra124-nyan-big.dts   | 2 +-
 arch/arm/dts/tegra20-colibri.dts     | 2 +-
 arch/arm/dts/tegra20-harmony.dts     | 4 ++--
 arch/arm/dts/tegra20-medcom-wide.dts | 2 +-
 arch/arm/dts/tegra20-paz00.dts       | 2 +-
 arch/arm/dts/tegra20-plutux.dts      | 2 +-
 arch/arm/dts/tegra20-seaboard.dts    | 4 ++--
 arch/arm/dts/tegra20-tec.dts         | 2 +-
 arch/arm/dts/tegra20-trimslice.dts   | 4 ++--
 arch/arm/dts/tegra20-ventana.dts     | 2 +-
 arch/arm/dts/tegra20-whistler.dts    | 2 +-
 11 files changed, 14 insertions(+), 14 deletions(-)
#45 lore raw

PATCH 11/60 ARM: tegra: add DT alias for GPIO controller

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Future Tegra chips contain multiple entirely separate GPIO controllers. It is plausible that boards using those chips will end up with non-DT-driven code that manipulates GPIOs, just like a few Tegra boards do today. In that case, we'll want to make sure that the mapping from the global integer GPIO numbering to GPIO controller occurs in a defined order, so that the right GPIO is chosen in each case. To guarantee that order, GPIO controllers must have specific DM "seq" values. This can be ensured via DT aliases.

This is a no-op for current chips since there's only one GPIO controller. However, it provides a good example for cargo-cult programming:-)

The aliases are added to the SoC DTSI files since there is no need for them to vary between boards, and doing so avoids having to duplicate the entry in each board's DT file. Any additional board-specific GPIO controllers can be referenced by additional aliases (starting at 1) in board DT files if needed.

---
 arch/arm/dts/tegra114.dtsi | 4 ++++
 arch/arm/dts/tegra20.dtsi  | 4 ++++
 arch/arm/dts/tegra210.dtsi | 4 ++++
 arch/arm/dts/tegra30.dtsi  | 4 ++++
 4 files changed, 16 insertions(+)
arch/arm/dts/tegra114.dtsi +4 -0
index 88bdc4904508..fd43cb1805aa 100644
@@ -7,6 +7,10 @@
 / {
 	compatible = "nvidia,tegra114";
 
+	aliases {
+		gpio0 = "/gpio at 6000d000";
+	};
+
 	tegra_car: clock {
 		compatible = "nvidia,tegra114-car";
 		reg = <0x60006000 0x1000>;
arch/arm/dts/tegra20.dtsi +4 -0
index 31223e4fc9aa..fd1197e73d30 100644
@@ -9,6 +9,10 @@
 	compatible = "nvidia,tegra20";
 	interrupt-parent = <&lic>;
 
+	aliases {
+		gpio0 = "/gpio at 6000d000";
+	};
+
 	host1x at 50000000 {
 		u-boot,dm-pre-reloc;
 		compatible = "nvidia,tegra20-host1x", "simple-bus";
arch/arm/dts/tegra210.dtsi +4 -0
index fd4cc793d906..8f6a30851e21 100644
@@ -12,6 +12,10 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		gpio0 = "/gpio at 6000d000";
+	};
+
 	pcie-controller at 01003000 {
 		compatible = "nvidia,tegra210-pcie";
 		device_type = "pci";
arch/arm/dts/tegra30.dtsi +4 -0
index 5ea7e347f3fa..f6d4fd54d4f3 100644
@@ -8,6 +8,10 @@
 	compatible = "nvidia,tegra30";
 	interrupt-parent = <&intc>;
 
+	aliases {
+		gpio0 = "/gpio at 6000d000";
+	};
+
 	intc: interrupt-controller at 50041000 {
 		compatible = "arm,cortex-a9-gic";
 		reg = <0x50041000 0x1000
Signature · 1 line
2.8.1
#46 lore raw

PATCH 11/60 ARM: tegra: add DT alias for GPIO controller

Quoted 20 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Future Tegra chips contain multiple entirely separate GPIO controllers. It is plausible that boards using those chips will end up with non-DT-driven code that manipulates GPIOs, just like a few Tegra boards do today. In that case, we'll want to make sure that the mapping from the global integer GPIO numbering to GPIO controller occurs in a defined order, so that the right GPIO is chosen in each case. To guarantee that order, GPIO controllers must have specific DM "seq" values. This can be ensured via DT aliases.

This is a no-op for current chips since there's only one GPIO controller. However, it provides a good example for cargo-cult programming:-)

The aliases are added to the SoC DTSI files since there is no need for them to vary between boards, and doing so avoids having to duplicate the entry in each board's DT file. Any additional board-specific GPIO controllers can be referenced by additional aliases (starting at 1) in board DT files if needed.

Quoted 7 lines
---
 arch/arm/dts/tegra114.dtsi | 4 ++++
 arch/arm/dts/tegra20.dtsi  | 4 ++++
 arch/arm/dts/tegra210.dtsi | 4 ++++
 arch/arm/dts/tegra30.dtsi  | 4 ++++
 4 files changed, 16 insertions(+)
#47 lore raw

PATCH 12/60 gpio: tegra: remove duplicate define

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

TEGRA_PORTS_PER_BANK and TEGRA_GPIO_PORTS represent the same thing. TEGRA_GPIO_PORTS is more widely used, so replace all usage with that, and remove the redundant definition.

---
 arch/arm/include/asm/arch-tegra/gpio.h | 1 -
 drivers/gpio/tegra_gpio.c              | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)
arch/arm/include/asm/arch-tegra/gpio.h +0 -1
index 363d16c486d1..07921f34b9d7 100644
@@ -9,7 +9,6 @@
 #define _TEGRA_GPIO_H_
 
 #define TEGRA_GPIOS_PER_PORT	8
-#define TEGRA_PORTS_PER_BANK	4
 
 #define GPIO_BANK(x)		((x) >> 5)
 #define GPIO_PORT(x)		(((x) >> 3) & 0x3)
drivers/gpio/tegra_gpio.c +3 -3
index 5a031159ca37..9abab13daaa9 100644
@@ -1,6 +1,6 @@
 /*
  * NVIDIA Tegra20 GPIO handling.
- *  (C) Copyright 2010-2012,2015
+ *  (C) Copyright 2010-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -346,7 +346,7 @@ static int gpio_tegra_bind(struct udevice *parent)
 	for (bank = 0; bank < bank_count; bank++) {
 		int port;
 
-		for (port = 0; port < TEGRA_PORTS_PER_BANK; port++) {
+		for (port = 0; port < TEGRA_GPIO_PORTS; port++) {
 			struct tegra_gpio_platdata *plat;
 			struct udevice *dev;
 			int base_port;
@@ -355,7 +355,7 @@ static int gpio_tegra_bind(struct udevice *parent)
 			if (!plat)
 				return -ENOMEM;
 			plat->bank = &ctlr->gpio_bank[bank];
-			base_port = bank * TEGRA_PORTS_PER_BANK + port;
+			base_port = bank * TEGRA_GPIO_PORTS + port;
 			plat->base_gpio = TEGRA_GPIOS_PER_PORT * base_port;
 			plat->port_name = gpio_port_name(base_port);
 
Signature · 1 line
2.8.1
#48 lore raw

PATCH 12/60 gpio: tegra: remove duplicate define

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

TEGRA_PORTS_PER_BANK and TEGRA_GPIO_PORTS represent the same thing. TEGRA_GPIO_PORTS is more widely used, so replace all usage with that, and remove the redundant definition.

---
 arch/arm/include/asm/arch-tegra/gpio.h | 1 -
 drivers/gpio/tegra_gpio.c              | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)
#49 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

The order is general includes, general asm includes, arch asm includes, local files.

---
 board/avionic-design/common/tamonten-ng.c | 5 +++--
 board/nvidia/cardhu/cardhu.c              | 6 +++---
 board/nvidia/jetson-tk1/jetson-tk1.c      | 4 +---
 board/nvidia/nyan-big/nyan-big.c          | 6 +++---
 board/nvidia/p2571/p2571.c                | 4 ++--
 board/nvidia/seaboard/seaboard.c          | 6 +++---
 board/toradex/colibri_t20/colibri_t20.c   | 6 +++---
 board/toradex/colibri_t30/colibri_t30.c   | 6 +++---
 8 files changed, 21 insertions(+), 22 deletions(-)
board/avionic-design/common/tamonten-ng.c +3 -2
index 170462711264..352f5d7ba5d1 100644
@@ -1,18 +1,19 @@
 /*
  * (C) Copyright 2013
  * Avionic Design GmbH <www.avionic-design.de>
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
 #include <common.h>
 #include <dm.h>
+#include <i2c.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/gpio.h>
-#include <asm/gpio.h>
 #include "pinmux-config-tamonten-ng.h"
-#include <i2c.h>
 
 #define PMU_I2C_ADDRESS		0x2D
 
board/nvidia/cardhu/cardhu.c +3 -3
index ba15e2e6cf0c..ffa74a3e8acb 100644
@@ -1,5 +1,5 @@
 /*
- *  (C) Copyright 2010-2013
+ *  (C) Copyright 2010-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -7,12 +7,12 @@
 
 #include <common.h>
 #include <dm.h>
+#include <i2c.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/gpio.h>
-#include <asm/gpio.h>
 #include "pinmux-config-cardhu.h"
-#include <i2c.h>
 
 #define PMU_I2C_ADDRESS		0x2D
 #define MAX_I2C_RETRY		3
board/nvidia/jetson-tk1/jetson-tk1.c +1 -3
index a66b710cddab..05f847e7f430 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2014
+ * (C) Copyright 2014-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -7,10 +7,8 @@
 
 #include <common.h>
 #include <power/as3722.h>
-
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
-
 #include "pinmux-config-jetson-tk1.h"
 
 DECLARE_GLOBAL_DATA_PTR;
board/nvidia/nyan-big/nyan-big.c +3 -3
index ba964018901a..8fef0d3d91a9 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2014
+ * (C) Copyright 2014-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -7,6 +7,8 @@
 
 #include <common.h>
 #include <errno.h>
+#include <power/as3722.h>
+#include <power/pmic.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/pinmux.h>
@@ -14,8 +16,6 @@
 #include <asm/arch/mc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
-#include <power/as3722.h>
-#include <power/pmic.h>
 #include "pinmux-config-nyan-big.h"
 
 /*
board/nvidia/p2571/p2571.c +2 -2
index d80a7d0d3e31..32c8da552b85 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2015
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -7,9 +7,9 @@
 
 #include <common.h>
 #include <i2c.h>
+#include <asm/gpio.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
-#include <asm/gpio.h>
 #include "max77620_init.h"
 #include "pinmux-config-p2571.h"
 
board/nvidia/seaboard/seaboard.c +3 -3
index 2d07001800e3..a8300742eed3 100644
@@ -1,19 +1,19 @@
 /*
- *  (C) Copyright 2010,2011
+ *  (C) Copyright 2010-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
 #include <common.h>
+#include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/board.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
-#include <asm/gpio.h>
+#include <asm/arch-tegra/board.h>
 
 /* TODO: Remove this code when the SPI switch is working */
 #if (CONFIG_MACH_TYPE != MACH_TYPE_VENTANA)
board/toradex/colibri_t20/colibri_t20.c +3 -3
index b9f845a09b6a..74421819d0f0 100644
@@ -6,14 +6,14 @@
  */
 
 #include <common.h>
+#include <i2c.h>
+#include <asm/gpio.h>
+#include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/tegra.h>
-#include <asm/gpio.h>
-#include <asm/io.h>
-#include <i2c.h>
 
 #define PMU_I2C_ADDRESS		0x34
 #define MAX_I2C_RETRY		3
board/toradex/colibri_t30/colibri_t30.c +3 -3
index 3902bff203d5..413cf1b498fe 100644
@@ -7,12 +7,12 @@
  */
 
 #include <common.h>
+#include <i2c.h>
+#include <asm/gpio.h>
+#include <asm/io.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch-tegra/tegra.h>
-#include <asm/gpio.h>
-#include <asm/io.h>
-#include <i2c.h>
 #include "pinmux-config-colibri_t30.h"
 
 int arch_misc_init(void)
Signature · 1 line
2.8.1
#50 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Quoted 6 lines · Stephen Warren

From: Stephen Warren <[email protected]>

The order is general includes, general asm includes, arch asm includes, local files.

Quoted 10 lines
---
 board/avionic-design/common/tamonten-ng.c | 5 +++--
 board/nvidia/cardhu/cardhu.c              | 6 +++---
 board/nvidia/jetson-tk1/jetson-tk1.c      | 4 +---
 board/nvidia/nyan-big/nyan-big.c          | 6 +++---
 board/nvidia/p2571/p2571.c                | 4 ++--
 board/nvidia/seaboard/seaboard.c          | 6 +++---
 board/toradex/colibri_t20/colibri_t20.c   | 6 +++---
 board/toradex/colibri_t30/colibri_t30.c   | 6 +++---
 8 files changed, 21 insertions(+), 22 deletions(-)
#51 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

In reply to Stephen Warren

Dear Stephen,

Quoted 15 lines · In message <[email protected]> you wrote:
board/avionic-design/common/tamonten-ng.c +2 -0
@@ -1,18 +1,19 @@
 /*
  * (C) Copyright 2013
  * Avionic Design GmbH <www.avionic-design.de>
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
 #include <common.h>
 #include <dm.h>
+#include <i2c.h>

board/avionic-design/common/tamonten-ng.c line 19

Quoted 10 lines
board/avionic-design/common/tamonten-ng.c +1 -2
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/gpio.h>
-#include <asm/gpio.h>
 #include "pinmux-config-tamonten-ng.h"
-#include <i2c.h>
 
 #define PMU_I2C_ADDRESS		0x2D
 

Do you really think that moving around two lines of code is a big enough creative achievement to justify adding a copyright note on it?

And even with "All rights reserved."?

I stop reviewing this patch set here. I'm sorry, but I really dislike the way how it - intentionally or unintentionally - appears to be driven by the attempt to increase Nvidias presence in copyright claims.

This seems not fair to me, and I would like to ask you to rework this whole patch set and be a little less aggressive in copyright claims.

Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
What is tolerance? -- it is the consequence of humanity. We  are  all
formed  of frailty and error; let us pardon reciprocally each other's
folly -- that is the first law of nature.                  - Voltaire
#52 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Quoted 26 lines · Wolfgang Denk

Dear Stephen,

Quoted 23 lines · In message <[email protected]> you wrote:
board/avionic-design/common/tamonten-ng.c +3 -2
@@ -1,18 +1,19 @@
  /*
   * (C) Copyright 2013
   * Avionic Design GmbH <www.avionic-design.de>
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
   *
   * SPDX-License-Identifier:	GPL-2.0+
   */
 
  #include <common.h>
  #include <dm.h>
+#include <i2c.h>
+#include <asm/gpio.h>
  #include <asm/arch/pinmux.h>
  #include <asm/arch/gp_padctrl.h>
  #include <asm/arch/gpio.h>
-#include <asm/gpio.h>
  #include "pinmux-config-tamonten-ng.h"
-#include <i2c.h>
 
Quoted 4 lines

board/avionic-design/common/tamonten-ng.c line 18

Quoted 1 line
board/avionic-design/common/tamonten-ng.c +0 -0
  #define PMU_I2C_ADDRESS		0x2D

Do you really think that moving around two lines of code is a big enough creative achievement to justify adding a copyright note on it?

My understanding is yes; I edited the file in a non-trival way and so NVIDIA's copyright applies to those portions. I'd consider whitespace or spelling fixes to be trivial, but not much else. I believe there is creative achievement in cleaning up the code-base this way.

Of course, I'm not a lawyer and I'm sure there are plenty of lawyers who could argue either way, perhaps depending on who pays them:-)

Quoted 4 lines

I'm sorry, but I really dislike
the way how it - intentionally or unintentionally - appears to be driven by the attempt to increase Nvidias presence in copyright claims.

FWIW, the purpose is to create a cleaner separate between the core Tegra SoC support code and board/driver code, to reduce their current rather tight coupling. The copyright changes are just correct application of the process of editing files; something I admit we/I've been a bit lax about in the past.

Quoted 2 lines

This seems not fair to me, and I would like to ask you to rework this whole patch set and be a little less aggressive in copyright claims.

I don't see what's unfair either way. As far as I'm concerned, the copyright notices are simply due to my following the process I must follow. I don't believe the presence of NVIDIA's copyright notices takes anything away from anyone else, and as I mentioned above, they seem valid to me.

#53 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Dear Stephen,

Quoted 25 lines · In message <[email protected]> you wrote:
Quoted 20 lines
Quoted 20 lines

/*
* (C) Copyright 2013
* Avionic Design GmbH <www.avionic-design.de>
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. *
* SPDX-License-Identifier: GPL-2.0+
*/

  #include <common.h>
  #include <dm.h>
board/avionic-design/common/tamonten-ng.c +2 -2
+#include <i2c.h>
+#include <asm/gpio.h>
  #include <asm/arch/pinmux.h>
  #include <asm/arch/gp_padctrl.h>
  #include <asm/arch/gpio.h>
-#include <asm/gpio.h>
  #include "pinmux-config-tamonten-ng.h"
-#include <i2c.h>
Quoted 4 lines
Quoted 1 line
  #define PMU_I2C_ADDRESS		0x2D

Do you really think that moving around two lines of code is a big enough creative achievement to justify adding a copyright note on it?

Quoted 4 lines

My understanding is yes; I edited the file in a non-trival way and so NVIDIA's copyright applies to those portions. I'd consider whitespace or spelling fixes to be trivial, but not much else. I believe there is creative achievement in cleaning up the code-base this way.

Well, do you _really_ mean that moving two ines of code a few lines up is a non-trivial change? Sorry, but I strongly disagree here.

This is not any change where you can claim any copyright for.

Quoted 5 lines

FWIW, the purpose is to create a cleaner separate between the core Tegra SoC support code and board/driver code, to reduce their current rather tight coupling. The copyright changes are just correct application of the process of editing files; something I admit we/I've been a bit lax about in the past.

s/correct/aggressive/

Quoted 8 lines
Quoted 2 lines

This seems not fair to me, and I would like to ask you to rework this whole patch set and be a little less aggressive in copyright claims.

I don't see what's unfair either way. As far as I'm concerned, the copyright notices are simply due to my following the process I must follow. I don't believe the presence of NVIDIA's copyright notices takes anything away from anyone else, and as I mentioned above, they seem valid to me.

Well, if I read the code before and after your changes, I see a lot of places where new copyright notes appear in prominent places, and some old ones are gone, or are now just an also-ran.

I do not think that this is your intention, but it is how this appears to me, and I really dislike it. It expresses an attitude I dislike.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The Wright Bothers weren't the first to fly. They were just the first
not to crash.
#54 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Quoted 28 lines · Wolfgang Denk

Dear Stephen,

Quoted 25 lines · In message <[email protected]> you wrote:
Quoted 24 lines
Quoted 11 lines

/*
* (C) Copyright 2013
* Avionic Design GmbH <www.avionic-design.de>
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. *
* SPDX-License-Identifier: GPL-2.0+
*/

  #include <common.h>
  #include <dm.h>

board/avionic-design/common/tamonten-ng.c line 18

Quoted 10 lines
board/avionic-design/common/tamonten-ng.c +2 -2
+#include <i2c.h>
+#include <asm/gpio.h>
  #include <asm/arch/pinmux.h>
  #include <asm/arch/gp_padctrl.h>
  #include <asm/arch/gpio.h>
-#include <asm/gpio.h>
  #include "pinmux-config-tamonten-ng.h"
-#include <i2c.h>
 
  #define PMU_I2C_ADDRESS		0x2D

Do you really think that moving around two lines of code is a big enough creative achievement to justify adding a copyright note on it?

Quoted 7 lines
Quoted 4 lines

My understanding is yes; I edited the file in a non-trival way and so NVIDIA's copyright applies to those portions. I'd consider whitespace or spelling fixes to be trivial, but not much else. I believe there is creative achievement in cleaning up the code-base this way.

Well, do you _really_ mean that moving two ines of code a few lines up is a non-trivial change? Sorry, but I strongly disagree here.

I want to echo my agreement on this point. Re-ordering includes does not rise to the level of adding copyright/author/etc lines. This is not the old days before various OSS projects used some sort of SCM and the only way you could show people you did X was to have your name somewhere.

Lawyers can argue, but projects have guidelines. I mean heck, I've see you remind people to fix the include order in new patches. Do they need to add an NVIDIA copyright notice too? No, of course not. Now, if your legal department is going to say that every change you make must include a new copyright notice, I'll be very sad and have to ask you to limit those kind of small clean-ups to places that already have a notice on them for NVIDIA.

Quoted 7 lines

This is not any change where you can claim any copyright for.

Quoted 5 lines

FWIW, the purpose is to create a cleaner separate between the core Tegra SoC support code and board/driver code, to reduce their current rather tight coupling. The copyright changes are just correct application of the process of editing files; something I admit we/I've been a bit lax about in the past.

I applaud re-organizing the code and making sure customer boards continue to work. But by that same token I do not know how Siemens would feel if I added TI notices to their platforms back when I was at TI and cleaning up and working on the SoC side of things. So it's not just NVIDIA legal and community folks that you need to consider here.

Quoted 10 lines

s/correct/aggressive/

Quoted 8 lines
Quoted 2 lines

This seems not fair to me, and I would like to ask you to rework this whole patch set and be a little less aggressive in copyright claims.

I don't see what's unfair either way. As far as I'm concerned, the copyright notices are simply due to my following the process I must follow. I don't believe the presence of NVIDIA's copyright notices takes anything away from anyone else, and as I mentioned above, they seem valid to me.

I know company lawyers come up with various policies and some are more restrictive than others. Anything about the exact guidelines you can share would be appreciated.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160425/6b8a85b5/attachment.sig>
#55 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

On 04/25/2016 05:22 PM, Tom Rini wrote:
...

Quoted 3 lines

I know company lawyers come up with various policies and some are more restrictive than others. Anything about the exact guidelines you can share would be appreciated.

They're simple and I would assume quite standard:

1) When creating a new file, add an NVIDIA copyright header.

2) When performing a non-trival edit to an existing file, if it has an existing NVIDIA copyright header, update the data, and if not, add one.

Guidance on "non-trivial" isn't given. I would take it to mean anything other than typos and whitespace fixes.

Re-ordering your email slightly:

Quoted 2 lines

I want to echo my agreement on this point. Re-ordering includes does not rise to the level of adding copyright/author/etc lines.

I can see your argument re: copyright headers in the individual files, although again I'd echo my previous comments re: a simple and unambiguous process being preferable.

However, I don't agree with that argument for the patch/series overall; it's certainly a creative process with work behind it to decide upon and implement the overall operation. But, if the changes to every individual file are trivial and the real work is in the idea (of the appropriate directory organization/separation) itself, there's nowhere left to represent that. Perhaps copyright should be applied to the patch as a whole, and represented in the patch description, rather than individual files in this case. I don't imagine that would satisfy lawyers though, since e.g. .tar distributions would not contain that meta-data. I wonder if an overall README listing all copyright holders and saying "for details, see git log" would be satisfactory to them, at least for "cleanup style" commits.

#56 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Dear Stephen,

Quoted 3 lines · In message <[email protected]> you wrote:

Guidance on "non-trivial" isn't given. I would take it to mean anything other than typos and whitespace fixes.

recommended search term: Copyright Creativity Requirement

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Even if you aren't in doubt, consider the mental welfare of the  per-
son who has to maintain the code after you, and who will probably put
parens in the wrong place.          - Larry Wall in the perl man page
#57 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Quoted 8 lines · In message <[email protected]> I wrote:

Dear Stephen,

Quoted 3 lines · In message <[email protected]> you wrote:

Guidance on "non-trivial" isn't given. I would take it to mean anything other than typos and whitespace fixes.

recommended search term: Copyright Creativity Requirement

Quoting from [1]:

4.1 Non-trivial originality (Durham)

In Durham Industries, Inc. v. Tomy Corp.,21 the Second Circuit Court of Appeals stated that copyright?s applicability to derivative works is subject to the limitation that ?the original aspects of a derivative work must be more than trivial.?
...
However, the Alfred Bell court considered non-trivial variation to be a requirement of the originality standard, and merely a restatement of the principle that, to be original, a work must be ?recognizably [the author?s] own.?
...

4.2 Substantial difference (Gracen)

[1] https://softwarefreedom.org/resources/2007/originality-requirements.html

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Chapter 1 -- The story so  far:
In the beginning the Universe was created. This has  made  a  lot  of
people very angry and been widely regarded as a bad move.
#58 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

In reply to Stephen Warren
Quoted 17 lines · Stephen Warren

On 04/25/2016 05:22 PM, Tom Rini wrote:
...

Quoted 3 lines

I know company lawyers come up with various policies and some are more restrictive than others. Anything about the exact guidelines you can share would be appreciated.

They're simple and I would assume quite standard:

1) When creating a new file, add an NVIDIA copyright header.

2) When performing a non-trival edit to an existing file, if it has an existing NVIDIA copyright header, update the data, and if not, add one.

Guidance on "non-trivial" isn't given. I would take it to mean anything other than typos and whitespace fixes.

Quoted 7 lines

Re-ordering your email slightly:

Quoted 2 lines

I want to echo my agreement on this point. Re-ordering includes does not rise to the level of adding copyright/author/etc lines.

I can see your argument re: copyright headers in the individual files, although again I'd echo my previous comments re: a simple and unambiguous process being preferable.

Here's where I hope I don't get everyone at NVIDIA that's doing Linux Kernel or other F/OSS work in trouble. Point #1 above is quite understandable. Point #2 is something I can see but has totally not been done by the folks doing Linux Kernel work.

What I do not want to see is a changing of the norms and when possible and makes sense, a deviation from the norms of the Linux Kernel. And that would be that you have to make a pretty huge change (at which point for maintainability and refactoring and so forth, it's probably a new file or set of new files) to add a Copyright line to an existing file. But we're not the kernel, true. But looking over the current changes for the year, same thing.

Now, if you want to instead make the point that in various cases fileB.c is based heavily on fileA.c and the copyright was missing on fileA.c when fileB.c was made, that makes sense. Or if they dropped the copyright line (and we assume no malice), add it back in.

But I do not want to see the threshold for "add your copyright to a file" be set at "made a non-whitespace/non-typo change".

Quoted 5 lines

However, I don't agree with that argument for the patch/series overall; it's certainly a creative process with work behind it to decide upon and implement the overall operation. But, if the changes to every individual file are trivial and the real work is in the idea (of the appropriate directory organization/separation) itself,

Quoted 8 lines

there's nowhere left to represent that. Perhaps copyright should be applied to the patch as a whole, and represented in the patch description, rather than individual files in this case. I don't imagine that would satisfy lawyers though, since e.g. .tar distributions would not contain that meta-data. I wonder if an overall README listing all copyright holders and saying "for details, see git log" would be satisfactory to them, at least for "cleanup style" commits.

The review on this patch series itself has indeed been derailed, which I do not like either. With respect to copyright on individual changes and so forth, is this a concern you have, or a concern the lawyers at NVIDIA have?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160426/7aaba61e/attachment.sig>
#59 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Quoted 22 lines · Tom Rini
Quoted 21 lines · Stephen Warren

On 04/25/2016 05:22 PM, Tom Rini wrote:
...

Quoted 3 lines

I know company lawyers come up with various policies and some are more restrictive than others. Anything about the exact guidelines you can share would be appreciated.

They're simple and I would assume quite standard:

1) When creating a new file, add an NVIDIA copyright header.

2) When performing a non-trival edit to an existing file, if it has an existing NVIDIA copyright header, update the data, and if not, add one.

Guidance on "non-trivial" isn't given. I would take it to mean anything other than typos and whitespace fixes.

Re-ordering your email slightly:

Quoted 2 lines

I want to echo my agreement on this point. Re-ordering includes does not rise to the level of adding copyright/author/etc lines.

Quoted 8 lines
Quoted 3 lines

I can see your argument re: copyright headers in the individual files, although again I'd echo my previous comments re: a simple and unambiguous process being preferable.

Here's where I hope I don't get everyone at NVIDIA that's doing Linux Kernel or other F/OSS work in trouble. Point #1 above is quite understandable. Point #2 is something I can see but has totally not been done by the folks doing Linux Kernel work.

Admittedly compliance is spotty; the last thing someone wants to do when having completed a patch is think about all kinds of nit-picks like updating copyrights, checkpatch, testing, even compiling:-)

However, it's certainly not unheard of. Here are a few examples I was able to spot quickly:

NVIDIA:
af6313d61a78 (Alex Courbot)
08acae34e8da (Paul Walsmley)
891846516317 (Thierry Reding)
783c8f4c8445 (Peter De Schrijver)
0ffdd4b61b13 (Stephen Warren)

Red Hat
1363074667a6 (Hans De Goede)
25462f7f5295 (Wei Huang)
54cea3f6681a (Milan Broz)

Texas Instruments
2f67864b6d5b (Andrew F. Davis)
0d6fa53fd805 (Andy Gross)

Denx
88eeb72ec4c1 (Stefan Roese)

Admittedly those don't look like refactoring changes, but it sounded to me like you were arguing completely against point (2) in my original email above. That's not reasonable. Arguing against (2) for simple refactoring could be.

Quoted 4 lines

The review on this patch series itself has indeed been derailed, which I do not like either. With respect to copyright on individual changes and so forth, is this a concern you have, or a concern the lawyers at NVIDIA have?

The lawyers have dictated the process which I should follow. I often forget, so I made sure that for such a large series I'd follow the process correctly this time. To be honest, I'm way beyond care about anything to do with copyright at this point; I'd rather just work on something where it wasn't an issue in any form at all.

#60 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Quoted 55 lines · Stephen Warren
Quoted 22 lines · Tom Rini
Quoted 21 lines · Stephen Warren

On 04/25/2016 05:22 PM, Tom Rini wrote:
...

Quoted 3 lines

I know company lawyers come up with various policies and some are more restrictive than others. Anything about the exact guidelines you can share would be appreciated.

They're simple and I would assume quite standard:

1) When creating a new file, add an NVIDIA copyright header.

2) When performing a non-trival edit to an existing file, if it has an existing NVIDIA copyright header, update the data, and if not, add one.

Guidance on "non-trivial" isn't given. I would take it to mean anything other than typos and whitespace fixes.

Re-ordering your email slightly:

Quoted 2 lines

I want to echo my agreement on this point. Re-ordering includes does not rise to the level of adding copyright/author/etc lines.

Quoted 8 lines
Quoted 3 lines

I can see your argument re: copyright headers in the individual files, although again I'd echo my previous comments re: a simple and unambiguous process being preferable.

Here's where I hope I don't get everyone at NVIDIA that's doing Linux Kernel or other F/OSS work in trouble. Point #1 above is quite understandable. Point #2 is something I can see but has totally not been done by the folks doing Linux Kernel work.

Admittedly compliance is spotty; the last thing someone wants to do when having completed a patch is think about all kinds of nit-picks like updating copyrights, checkpatch, testing, even compiling:-)

However, it's certainly not unheard of. Here are a few examples I was able to spot quickly:

NVIDIA:
af6313d61a78 (Alex Courbot)
08acae34e8da (Paul Walsmley)
891846516317 (Thierry Reding)
783c8f4c8445 (Peter De Schrijver)
0ffdd4b61b13 (Stephen Warren)

Red Hat
1363074667a6 (Hans De Goede)
25462f7f5295 (Wei Huang)
54cea3f6681a (Milan Broz)

Texas Instruments
2f67864b6d5b (Andrew F. Davis)
0d6fa53fd805 (Andy Gross)

Quoted 7 lines

Denx
88eeb72ec4c1 (Stefan Roese)

Admittedly those don't look like refactoring changes, but it sounded to me like you were arguing completely against point (2) in my original email above. That's not reasonable. Arguing against (2) for simple refactoring could be.

I'm arguing in favour of what all of those commits did, extending existing copyright notices. I'm fine with that. To be clear, in _this_ patch what I object to is adding the NVIDIA copyright line to board/avionic-design/common/tamonten-ng.c and I am fine with extending it on all of the board/nvidia/ files and now wondering you didn't add it to board/toradex/.

Quoted 10 lines
Quoted 4 lines

The review on this patch series itself has indeed been derailed, which I do not like either. With respect to copyright on individual changes and so forth, is this a concern you have, or a concern the lawyers at NVIDIA have?

The lawyers have dictated the process which I should follow. I often forget, so I made sure that for such a large series I'd follow the process correctly this time. To be honest, I'm way beyond care about anything to do with copyright at this point; I'd rather just work on something where it wasn't an issue in any form at all.

Indeed :(

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160426/fb64faf8/attachment.sig>
#61 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

In reply to Tom Rini
Quoted 3 lines · Tom Rini

Lawyers can argue, but projects have guidelines. I mean heck, I've see you remind people to fix the include order in new patches. Do they need to add an NVIDIA copyright notice too? No, of course not.

Well honestly all patch review does contribute to the creative process and affect the final result, so I don't actually think it'd be that much of a stretch that a reviewer's copyright applies to the final patch; they were involved in the creation of it. Perhaps Reviewed-by tags or the mailing list history would be enough evidence of this though, if such were needed later.

#62 lore raw

PATCH 13/60 ARM: tegra: sort some board file include directives

Quoted 6 lines · Stephen Warren
Quoted 3 lines · Tom Rini

Lawyers can argue, but projects have guidelines. I mean heck, I've see you remind people to fix the include order in new patches. Do they need to add an NVIDIA copyright notice too? No, of course not.

Quoted 6 lines

Well honestly all patch review does contribute to the creative process and affect the final result, so I don't actually think it'd be that much of a stretch that a reviewer's copyright applies to the final patch; they were involved in the creation of it. Perhaps Reviewed-by tags or the mailing list history would be enough evidence of this though, if such were needed later.

And this is why I love patchwork and hope that as it starts to handle series more directly it will also handle "For the series, ..." messages in addition to collecting up Acked/Reviewed/Tested by lines. These are important for history of changes to the codebase.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160426/c9b450fc/attachment.sig>
#63 lore raw

PATCH 14/60 ARM: tegra: use DT bindings for GPIO naming

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

There are currently many places that define the list of all Tegra GPIOs; the DT binding header and custom Tegra-specific header file gpio.h. Fix the redundancy by replacing everything with the DT binding header file.

---
 arch/arm/include/asm/arch-tegra124/gpio.h          | 261 +--------------------
 arch/arm/include/asm/arch-tegra20/gpio.h           | 229 +-----------------
 arch/arm/include/asm/arch-tegra210/gpio.h          | 261 +--------------------
 arch/arm/include/asm/arch-tegra30/gpio.h           | 253 +-------------------
 board/avionic-design/common/tamonten-ng.c          |  14 +-
 board/avionic-design/common/tamonten.c             |   5 +-
 board/nvidia/cardhu/cardhu.c                       |   6 +-
 board/nvidia/e2220-1170/e2220-1170.c               |   3 +-
 board/nvidia/e2220-1170/pinmux-config-e2220-1170.h | 122 +++++-----
 board/nvidia/jetson-tk1/jetson-tk1.c               |   1 +
 board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h | 106 ++++-----
 board/nvidia/nyan-big/nyan-big.c                   |   6 +-
 board/nvidia/nyan-big/pinmux-config-nyan-big.h     |  98 ++++----
 board/nvidia/p2371-0000/p2371-0000.c               |   3 +-
 board/nvidia/p2371-0000/pinmux-config-p2371-0000.h | 104 ++++----
 board/nvidia/p2371-2180/p2371-2180.c               |   3 +-
 board/nvidia/p2371-2180/pinmux-config-p2371-2180.h | 126 +++++-----
 board/nvidia/p2571/p2571.c                         |   5 +-
 board/nvidia/p2571/pinmux-config-p2571.h           |  54 ++---
 board/nvidia/seaboard/seaboard.c                   |   6 +-
 board/nvidia/venice2/pinmux-config-venice2.h       | 120 +++++-----
 board/nvidia/venice2/venice2.c                     |   3 +-
 board/toradex/colibri_t20/colibri_t20.c            |   7 +-
 board/toradex/colibri_t30/colibri_t30.c            |   7 +-
 24 files changed, 409 insertions(+), 1394 deletions(-)
arch/arm/include/asm/arch-tegra124/gpio.h +1 -260
index 1a6dcb8715d3..8fddb63f44c2 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -41,263 +41,4 @@ struct gpio_ctlr {
 	struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
 };
 
-enum gpio_pin {
-	GPIO_PA0 = 0,	/* pin 0 */
-	GPIO_PA1,
-	GPIO_PA2,
-	GPIO_PA3,
-	GPIO_PA4,
-	GPIO_PA5,
-	GPIO_PA6,
-	GPIO_PA7,
-	GPIO_PB0,	/* pin 8 */
-	GPIO_PB1,
-	GPIO_PB2,
-	GPIO_PB3,
-	GPIO_PB4,
-	GPIO_PB5,
-	GPIO_PB6,
-	GPIO_PB7,
-	GPIO_PC0,	/* pin 16 */
-	GPIO_PC1,
-	GPIO_PC2,
-	GPIO_PC3,
-	GPIO_PC4,
-	GPIO_PC5,
-	GPIO_PC6,
-	GPIO_PC7,
-	GPIO_PD0,	/* pin 24 */
-	GPIO_PD1,
-	GPIO_PD2,
-	GPIO_PD3,
-	GPIO_PD4,
-	GPIO_PD5,
-	GPIO_PD6,
-	GPIO_PD7,
-	GPIO_PE0,	/* pin 32 */
-	GPIO_PE1,
-	GPIO_PE2,
-	GPIO_PE3,
-	GPIO_PE4,
-	GPIO_PE5,
-	GPIO_PE6,
-	GPIO_PE7,
-	GPIO_PF0,	/* pin 40 */
-	GPIO_PF1,
-	GPIO_PF2,
-	GPIO_PF3,
-	GPIO_PF4,
-	GPIO_PF5,
-	GPIO_PF6,
-	GPIO_PF7,
-	GPIO_PG0,	/* pin 48 */
-	GPIO_PG1,
-	GPIO_PG2,
-	GPIO_PG3,
-	GPIO_PG4,
-	GPIO_PG5,
-	GPIO_PG6,
-	GPIO_PG7,
-	GPIO_PH0,	/* pin 56 */
-	GPIO_PH1,
-	GPIO_PH2,
-	GPIO_PH3,
-	GPIO_PH4,
-	GPIO_PH5,
-	GPIO_PH6,
-	GPIO_PH7,
-	GPIO_PI0,	/* pin 64 */
-	GPIO_PI1,
-	GPIO_PI2,
-	GPIO_PI3,
-	GPIO_PI4,
-	GPIO_PI5,
-	GPIO_PI6,
-	GPIO_PI7,
-	GPIO_PJ0,	/* pin 72 */
-	GPIO_PJ1,
-	GPIO_PJ2,
-	GPIO_PJ3,
-	GPIO_PJ4,
-	GPIO_PJ5,
-	GPIO_PJ6,
-	GPIO_PJ7,
-	GPIO_PK0,	/* pin 80 */
-	GPIO_PK1,
-	GPIO_PK2,
-	GPIO_PK3,
-	GPIO_PK4,
-	GPIO_PK5,
-	GPIO_PK6,
-	GPIO_PK7,
-	GPIO_PL0,	/* pin 88 */
-	GPIO_PL1,
-	GPIO_PL2,
-	GPIO_PL3,
-	GPIO_PL4,
-	GPIO_PL5,
-	GPIO_PL6,
-	GPIO_PL7,
-	GPIO_PM0,	/* pin 96 */
-	GPIO_PM1,
-	GPIO_PM2,
-	GPIO_PM3,
-	GPIO_PM4,
-	GPIO_PM5,
-	GPIO_PM6,
-	GPIO_PM7,
-	GPIO_PN0,	/* pin 104 */
-	GPIO_PN1,
-	GPIO_PN2,
-	GPIO_PN3,
-	GPIO_PN4,
-	GPIO_PN5,
-	GPIO_PN6,
-	GPIO_PN7,
-	GPIO_PO0,	/* pin 112 */
-	GPIO_PO1,
-	GPIO_PO2,
-	GPIO_PO3,
-	GPIO_PO4,
-	GPIO_PO5,
-	GPIO_PO6,
-	GPIO_PO7,
-	GPIO_PP0,	/* pin 120 */
-	GPIO_PP1,
-	GPIO_PP2,
-	GPIO_PP3,
-	GPIO_PP4,
-	GPIO_PP5,
-	GPIO_PP6,
-	GPIO_PP7,
-	GPIO_PQ0,	/* pin 128 */
-	GPIO_PQ1,
-	GPIO_PQ2,
-	GPIO_PQ3,
-	GPIO_PQ4,
-	GPIO_PQ5,
-	GPIO_PQ6,
-	GPIO_PQ7,
-	GPIO_PR0,	/* pin 136 */
-	GPIO_PR1,
-	GPIO_PR2,
-	GPIO_PR3,
-	GPIO_PR4,
-	GPIO_PR5,
-	GPIO_PR6,
-	GPIO_PR7,
-	GPIO_PS0,	/* pin 144 */
-	GPIO_PS1,
-	GPIO_PS2,
-	GPIO_PS3,
-	GPIO_PS4,
-	GPIO_PS5,
-	GPIO_PS6,
-	GPIO_PS7,
-	GPIO_PT0,	/* pin 152 */
-	GPIO_PT1,
-	GPIO_PT2,
-	GPIO_PT3,
-	GPIO_PT4,
-	GPIO_PT5,
-	GPIO_PT6,
-	GPIO_PT7,
-	GPIO_PU0,	/* pin 160 */
-	GPIO_PU1,
-	GPIO_PU2,
-	GPIO_PU3,
-	GPIO_PU4,
-	GPIO_PU5,
-	GPIO_PU6,
-	GPIO_PU7,
-	GPIO_PV0,	/* pin 168 */
-	GPIO_PV1,
-	GPIO_PV2,
-	GPIO_PV3,
-	GPIO_PV4,
-	GPIO_PV5,
-	GPIO_PV6,
-	GPIO_PV7,
-	GPIO_PW0,	/* pin 176 */
-	GPIO_PW1,
-	GPIO_PW2,
-	GPIO_PW3,
-	GPIO_PW4,
-	GPIO_PW5,
-	GPIO_PW6,
-	GPIO_PW7,
-	GPIO_PX0,	/* pin 184 */
-	GPIO_PX1,
-	GPIO_PX2,
-	GPIO_PX3,
-	GPIO_PX4,
-	GPIO_PX5,
-	GPIO_PX6,
-	GPIO_PX7,
-	GPIO_PY0,	/* pin 192 */
-	GPIO_PY1,
-	GPIO_PY2,
-	GPIO_PY3,
-	GPIO_PY4,
-	GPIO_PY5,
-	GPIO_PY6,
-	GPIO_PY7,
-	GPIO_PZ0,	/* pin 200 */
-	GPIO_PZ1,
-	GPIO_PZ2,
-	GPIO_PZ3,
-	GPIO_PZ4,
-	GPIO_PZ5,
-	GPIO_PZ6,
-	GPIO_PZ7,
-	GPIO_PAA0,	/* pin 208 */
-	GPIO_PAA1,
-	GPIO_PAA2,
-	GPIO_PAA3,
-	GPIO_PAA4,
-	GPIO_PAA5,
-	GPIO_PAA6,
-	GPIO_PAA7,
-	GPIO_PBB0,	/* pin 216 */
-	GPIO_PBB1,
-	GPIO_PBB2,
-	GPIO_PBB3,
-	GPIO_PBB4,
-	GPIO_PBB5,
-	GPIO_PBB6,
-	GPIO_PBB7,
-	GPIO_PCC0,	/* pin 224 */
-	GPIO_PCC1,
-	GPIO_PCC2,
-	GPIO_PCC3,
-	GPIO_PCC4,
-	GPIO_PCC5,
-	GPIO_PCC6,
-	GPIO_PCC7,
-	GPIO_PDD0,	/* pin 232 */
-	GPIO_PDD1,
-	GPIO_PDD2,
-	GPIO_PDD3,
-	GPIO_PDD4,
-	GPIO_PDD5,
-	GPIO_PDD6,
-	GPIO_PDD7,
-	GPIO_PEE0,	/* pin 240 */
-	GPIO_PEE1,
-	GPIO_PEE2,
-	GPIO_PEE3,
-	GPIO_PEE4,
-	GPIO_PEE5,
-	GPIO_PEE6,
-	GPIO_PEE7,
-	GPIO_PFF0,	/* pin 248 */
-	GPIO_PFF1,
-	GPIO_PFF2,
-	GPIO_PFF3,
-	GPIO_PFF4,
-	GPIO_PFF5,
-	GPIO_PFF6,
-	GPIO_PFF7,	/* pin 255 */
-};
-
 #endif	/* _TEGRA124_GPIO_H_ */
arch/arm/include/asm/arch-tegra20/gpio.h +1 -228

238 lines not on this page · raw message

arch/arm/include/asm/arch-tegra210/gpio.h +1 -260

269 lines not on this page · raw message

arch/arm/include/asm/arch-tegra30/gpio.h +1 -252

261 lines not on this page · raw message

board/avionic-design/common/tamonten-ng.c +7 -7
index 352f5d7ba5d1..aa1fd0ebce1e 100644
@@ -9,10 +9,10 @@
 #include <common.h>
 #include <dm.h>
 #include <i2c.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/gp_padctrl.h>
-#include <asm/arch/gpio.h>
 #include "pinmux-config-tamonten-ng.h"
 
 #define PMU_I2C_ADDRESS		0x2D
@@ -43,12 +43,12 @@ void pinmux_init(void)
 void gpio_early_init(void)
 {
 	/* Turn on the alive signal */
-	gpio_request(GPIO_PV2, "ALIVE");
-	gpio_direction_output(GPIO_PV2, 1);
+	gpio_request(TEGRA_GPIO(V, 2), "ALIVE");
+	gpio_direction_output(TEGRA_GPIO(V, 2), 1);
 
 	/* Remove the reset on the external periph */
-	gpio_request(GPIO_PI4, "nRST_PERIPH");
-	gpio_direction_output(GPIO_PI4, 1);
+	gpio_request(TEGRA_GPIO(I, 4), "nRST_PERIPH");
+	gpio_direction_output(TEGRA_GPIO(I, 4), 1);
 }
 
 void pmu_write(uchar reg, uchar data)
@@ -74,8 +74,8 @@ void board_sdmmc_voltage_init(void)
 	pmu_write(PMU_REG_LDO5, PMU_LDO5(HIGH_POWER, 3300));
 
 	/* Switch the power on */
-	gpio_request(GPIO_PJ2, "EN_3V3_EMMC");
-	gpio_direction_output(GPIO_PJ2, 1);
+	gpio_request(TEGRA_GPIO(J, 2), "EN_3V3_EMMC");
+	gpio_direction_output(TEGRA_GPIO(J, 2), 1);
 }
 
 /*
board/avionic-design/common/tamonten.c +3 -2
index 981862ce1aff..c05113c1c36c 100644
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <ns16550.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/arch/clock.h>
@@ -22,8 +23,8 @@
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 void gpio_early_init(void)
 {
-	gpio_request(GPIO_PI4, NULL);
-	gpio_direction_output(GPIO_PI4, 1);
+	gpio_request(TEGRA_GPIO(I, 4), NULL);
+	gpio_direction_output(TEGRA_GPIO(I, 4), 1);
 }
 #endif
 
board/nvidia/cardhu/cardhu.c +3 -3
index ffa74a3e8acb..ff46e0cf0419 100644
@@ -8,10 +8,10 @@
 #include <common.h>
 #include <dm.h>
 #include <i2c.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/gp_padctrl.h>
-#include <asm/arch/gpio.h>
 #include "pinmux-config-cardhu.h"
 
 #define PMU_I2C_ADDRESS		0x2D
@@ -110,11 +110,11 @@ int tegra_pcie_board_init(void)
 	}
 
 	/* GPIO: PEX = 3.3V */
-	err = gpio_request(GPIO_PL7, "PEX");
+	err = gpio_request(TEGRA_GPIO(L, 7), "PEX");
 	if (err < 0)
 		return err;
 
-	gpio_direction_output(GPIO_PL7, 1);
+	gpio_direction_output(TEGRA_GPIO(L, 7), 1);
 
 	/* TPS659110: LDO2_REG = 1.05V, ACTIVE */
 	data[0] = 0x15;
board/nvidia/e2220-1170/e2220-1170.c +2 -1
index d66a72e5204c..db6fa74ae1fe 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2015
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <i2c.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include "../p2571/max77620_init.h"
board/nvidia/e2220-1170/pinmux-config-e2220-1170.h +61 -61

137 lines not on this page · raw message

board/nvidia/jetson-tk1/jetson-tk1.c +1 -0
index 05f847e7f430..4b7058e3bc89 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <power/as3722.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h +53 -53

121 lines not on this page · raw message

board/nvidia/nyan-big/nyan-big.c +4 -2
index 8fef0d3d91a9..56e15bda93ec 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <power/as3722.h>
 #include <power/pmic.h>
 #include <asm/gpio.h>
@@ -36,8 +37,9 @@ void pinmux_init(void)
 
 int tegra_board_id(void)
 {
-	static const int vector[] = {GPIO_PQ3, GPIO_PT1, GPIO_PX1,
-					GPIO_PX4, -1};
+	static const int vector[] = {TEGRA_GPIO(Q, 3), TEGRA_GPIO(T, 1),
+					TEGRA_GPIO(X, 1), TEGRA_GPIO(X, 4),
+					-1};
 
 	gpio_claim_vector(vector, "board_id%d");
 	return gpio_get_values_as_int(vector);
board/nvidia/nyan-big/pinmux-config-nyan-big.h +49 -49

113 lines not on this page · raw message

board/nvidia/p2371-0000/p2371-0000.c +2 -1
index 9df543a4c9e8..0fec3d497d7d 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2015
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <i2c.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include "../p2571/max77620_init.h"
board/nvidia/p2371-0000/pinmux-config-p2371-0000.h +52 -52

119 lines not on this page · raw message

board/nvidia/p2371-2180/p2371-2180.c +2 -1
index 0f587eaaa796..bc3389976942 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2013-2015
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <i2c.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include "../p2571/max77620_init.h"
board/nvidia/p2371-2180/pinmux-config-p2371-2180.h +63 -63

141 lines not on this page · raw message

board/nvidia/p2571/p2571.c +3 -2
index 32c8da552b85..794830bac3b3 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <i2c.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
@@ -58,6 +59,6 @@ void pinmux_init(void)
 void start_cpu_fan(void)
 {
 	/* GPIO_PE4 is PS_VDD_FAN_ENABLE */
-	gpio_request(GPIO_PE4, "FAN_VDD");
-	gpio_direction_output(GPIO_PE4, 1);
+	gpio_request(TEGRA_GPIO(E, 4), "FAN_VDD");
+	gpio_direction_output(TEGRA_GPIO(E, 4), 1);
 }
board/nvidia/p2571/pinmux-config-p2571.h +27 -27

69 lines not on this page · raw message

board/nvidia/seaboard/seaboard.c +3 -3
index a8300742eed3..9c92fc2e29e2 100644
@@ -6,12 +6,12 @@
  */
 
 #include <common.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
-#include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch-tegra/board.h>
 
@@ -20,8 +20,8 @@
 void gpio_early_init_uart(void)
 {
 	/* Enable UART via GPIO_PI3 (port 8, bit 3) so serial console works */
-	gpio_request(GPIO_PI3, "uart_en");
-	gpio_direction_output(GPIO_PI3, 0);
+	gpio_request(TEGRA_GPIO(I, 3), "uart_en");
+	gpio_direction_output(TEGRA_GPIO(I, 3), 0);
 }
 #endif
 
board/nvidia/venice2/pinmux-config-venice2.h +60 -60

135 lines not on this page · raw message

board/nvidia/venice2/venice2.c +2 -1
index c56ef129d6c7..4373de6a26bd 100644
@@ -1,11 +1,12 @@
 /*
- * (C) Copyright 2013-2014
+ * (C) Copyright 2013-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include "pinmux-config-venice2.h"
board/toradex/colibri_t20/colibri_t20.c +4 -3
index 74421819d0f0..e47565fa6389 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <i2c.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
@@ -103,11 +104,11 @@ void pin_mux_usb(void)
 	pinmux_tristate_disable(PMUX_PINGRP_DTE);
 
 	/* Reset ASIX using LAN_RESET */
-	gpio_request(GPIO_PV4, "LAN_RESET");
-	gpio_direction_output(GPIO_PV4, 0);
+	gpio_request(TEGRA_GPIO(V, 4), "LAN_RESET");
+	gpio_direction_output(TEGRA_GPIO(V, 4), 0);
 	pinmux_tristate_disable(PMUX_PINGRP_GPV);
 	udelay(5);
-	gpio_set_value(GPIO_PV4, 1);
+	gpio_set_value(TEGRA_GPIO(V, 4), 1);
 
 	/* USBH_PEN: USB 1 aka Tegra USB port 3 VBus */
 	pinmux_tristate_disable(PMUX_PINGRP_SPIG);
board/toradex/colibri_t30/colibri_t30.c +4 -3
index 413cf1b498fe..4312f79f2d00 100644
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <i2c.h>
+#include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/gp_padctrl.h>
@@ -47,8 +48,8 @@ void pinmux_init(void)
 void pin_mux_usb(void)
 {
 	/* Reset ASIX using LAN_RESET */
-	gpio_request(GPIO_PDD0, "LAN_RESET");
-	gpio_direction_output(GPIO_PDD0, 0);
+	gpio_request(TEGRA_GPIO(DD, 0), "LAN_RESET");
+	gpio_direction_output(TEGRA_GPIO(DD, 0), 0);
 	udelay(5);
-	gpio_set_value(GPIO_PDD0, 1);
+	gpio_set_value(TEGRA_GPIO(DD, 0), 1);
 }
Signature · 1 line
2.8.1
#64 lore raw

PATCH 14/60 ARM: tegra: use DT bindings for GPIO naming

Quoted 25 lines · Stephen Warren

From: Stephen Warren <[email protected]>

There are currently many places that define the list of all Tegra GPIOs; the DT binding header and custom Tegra-specific header file gpio.h. Fix the redundancy by replacing everything with the DT binding header file.

---
 arch/arm/include/asm/arch-tegra124/gpio.h          | 261 +--------------------
 arch/arm/include/asm/arch-tegra20/gpio.h           | 229 +-----------------
 arch/arm/include/asm/arch-tegra210/gpio.h          | 261 +--------------------
 arch/arm/include/asm/arch-tegra30/gpio.h           | 253 +-------------------
 board/avionic-design/common/tamonten-ng.c          |  14 +-
 board/avionic-design/common/tamonten.c             |   5 +-
 board/nvidia/cardhu/cardhu.c                       |   6 +-
 board/nvidia/e2220-1170/e2220-1170.c               |   3 +-
 board/nvidia/e2220-1170/pinmux-config-e2220-1170.h | 122 +++++-----
 board/nvidia/jetson-tk1/jetson-tk1.c               |   1 +
 board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h | 106 ++++-----
 board/nvidia/nyan-big/nyan-big.c                   |   6 +-
 board/nvidia/nyan-big/pinmux-config-nyan-big.h     |  98 ++++----
 board/nvidia/p2371-0000/p2371-0000.c               |   3 +-
 board/nvidia/p2371-0000/pinmux-config-p2371-0000.h | 104 ++++----
 board/nvidia/p2371-2180/p2371-2180.c               |   3 +-
 board/nvidia/p2371-2180/pinmux-config-p2371-2180.h | 126 +++++-----
Quoted 8 lines
 board/nvidia/p2571/p2571.c                         |   5 +-
 board/nvidia/p2571/pinmux-config-p2571.h           |  54 ++---
 board/nvidia/seaboard/seaboard.c                   |   6 +-
 board/nvidia/venice2/pinmux-config-venice2.h       | 120 +++++-----
 board/nvidia/venice2/venice2.c                     |   3 +-
 board/toradex/colibri_t20/colibri_t20.c            |   7 +-
 board/toradex/colibri_t30/colibri_t30.c            |   7 +-
 24 files changed, 409 insertions(+), 1394 deletions(-)
#65 lore raw

PATCH 15/60 gpio: tegra: header file split

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's gpio.h contains a mix of private definitions for use inside the GPIO driver and custom machine-specific APIs. Move the private definitions out of the global include directory since nothing should need to access them. Move the public definitions to the machine-specific include directory <mach/>.

---
 arch/arm/include/asm/arch-tegra114/gpio.h          | 20 ------
 arch/arm/include/asm/arch-tegra124/gpio.h          | 44 -------------
 arch/arm/include/asm/arch-tegra20/gpio.h           | 36 ----------
 arch/arm/include/asm/arch-tegra210/gpio.h          | 44 -------------
 arch/arm/include/asm/arch-tegra30/gpio.h           | 43 ------------
 arch/arm/include/asm/gpio.h                        |  2 +-
 .../include/mach/tegra_gpio.h}                     | 13 +---
 board/nvidia/e2220-1170/e2220-1170.c               |  3 +-
 board/nvidia/jetson-tk1/jetson-tk1.c               |  3 +-
 board/nvidia/nyan-big/nyan-big.c                   |  1 +
 board/nvidia/p2371-0000/p2371-0000.c               |  3 +-
 board/nvidia/p2371-2180/p2371-2180.c               |  3 +-
 board/nvidia/p2571/p2571.c                         |  2 +-
 board/nvidia/venice2/venice2.c                     |  3 +-
 drivers/gpio/tegra_gpio.c                          |  2 +
 drivers/gpio/tegra_gpio_priv.h                     | 76 ++++++++++++++++++++++
 drivers/i2c/tegra_i2c.c                            |  1 -
 17 files changed, 94 insertions(+), 205 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra114/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/gpio.h
 rename arch/arm/{include/asm/arch-tegra/gpio.h => mach-tegra/include/mach/tegra_gpio.h} (67%)
 create mode 100644 drivers/gpio/tegra_gpio_priv.h
arch/arm/include/asm/arch-tegra114/gpio.h deleted +0 -20
deleted file mode 100644
index d6eaa1bd40e8..000000000000
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
- *
- * SPDX-License-Identifier:	GPL-2.0
- */
-
-#ifndef _TEGRA114_GPIO_H_
-#define _TEGRA114_GPIO_H_
-
-/*
- * The Tegra114 GPIO controller has 246 GPIOS in 8 banks of 4 ports,
- * each with 8 GPIOs.
- */
-#define TEGRA_GPIO_PORTS	4	/* number of ports per bank */
-#define TEGRA_GPIO_BANKS	8	/* number of banks */
-
-#include <asm/arch-tegra/gpio.h>
-#include <asm/arch-tegra30/gpio.h>
-
-#endif	/* _TEGRA114_GPIO_H_ */
arch/arm/include/asm/arch-tegra124/gpio.h deleted +0 -44

44 lines not on this page · raw message

arch/arm/include/asm/arch-tegra20/gpio.h deleted +0 -36
deleted file mode 100644
index 46dcc28f727c..000000000000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011, Google Inc. All rights reserved.
- * Portions Copyright 2011-2016 NVIDIA Corporation
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef _TEGRA20_GPIO_H_
-#define _TEGRA20_GPIO_H_
-
-/*
- * The Tegra 2x GPIO controller has 224 GPIOs arranged in 7 banks of 4 ports,
- * each with 8 GPIOs.
- */
-#define TEGRA_GPIO_PORTS	4	/* number of ports per bank */
-#define TEGRA_GPIO_BANKS	7	/* number of banks */
-
-#include <asm/arch-tegra/gpio.h>
-
-/* GPIO Controller registers for a single bank */
-struct gpio_ctlr_bank {
-	uint gpio_config[TEGRA_GPIO_PORTS];
-	uint gpio_dir_out[TEGRA_GPIO_PORTS];
-	uint gpio_out[TEGRA_GPIO_PORTS];
-	uint gpio_in[TEGRA_GPIO_PORTS];
-	uint gpio_int_status[TEGRA_GPIO_PORTS];
-	uint gpio_int_enable[TEGRA_GPIO_PORTS];
-	uint gpio_int_level[TEGRA_GPIO_PORTS];
-	uint gpio_int_clear[TEGRA_GPIO_PORTS];
-};
-
-struct gpio_ctlr {
-	struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
-};
-
-#endif	/* TEGRA20_GPIO_H_ */
arch/arm/include/asm/arch-tegra210/gpio.h deleted +0 -44

44 lines not on this page · raw message

arch/arm/include/asm/arch-tegra30/gpio.h deleted +0 -43

43 lines not on this page · raw message

arch/arm/include/asm/gpio.h +1 -1
index fe4419cae4cf..751a5ade17c7 100644
@@ -1,4 +1,4 @@
-#ifndef CONFIG_ARCH_UNIPHIER
+#if !defined(CONFIG_ARCH_UNIPHIER) && !defined(CONFIG_TEGRA)
 #include <asm/arch/gpio.h>
 #endif
 #include <asm-generic/gpio.h>
arch/arm/mach-tegra/include/mach/tegra_gpio.h renamed from arch/arm/include/asm/arch-tegra/gpio.h +3 -10
similarity index 67%
rename from arch/arm/include/asm/arch-tegra/gpio.h
rename to arch/arm/mach-tegra/include/mach/tegra_gpio.h
index 07921f34b9d7..09b813bc79ac 100644
@@ -5,15 +5,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _TEGRA_GPIO_H_
-#define _TEGRA_GPIO_H_
-
-#define TEGRA_GPIOS_PER_PORT	8
-
-#define GPIO_BANK(x)		((x) >> 5)
-#define GPIO_PORT(x)		(((x) >> 3) & 0x3)
-#define GPIO_FULLPORT(x)	((x) >> 3)
-#define GPIO_BIT(x)		((x) & 0x7)
+#ifndef _MACH_TEGRA_GPIO_H
+#define _MACH_TEGRA_GPIO_H
 
 enum tegra_gpio_init {
 	TEGRA_GPIO_INIT_IN,
@@ -34,4 +27,4 @@ struct tegra_gpio_config {
  */
 void gpio_config_table(const struct tegra_gpio_config *config, int len);
 
-#endif	/* TEGRA_GPIO_H_ */
+#endif
board/nvidia/e2220-1170/e2220-1170.c +2 -1
index db6fa74ae1fe..c2b5e5e09d21 100644
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <i2c.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "../p2571/max77620_init.h"
 #include "pinmux-config-e2220-1170.h"
 
board/nvidia/jetson-tk1/jetson-tk1.c +2 -1
index 4b7058e3bc89..422a18a4e530 100644
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
 #include <power/as3722.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "pinmux-config-jetson-tk1.h"
 
 DECLARE_GLOBAL_DATA_PTR;
board/nvidia/nyan-big/nyan-big.c +1 -0
index 56e15bda93ec..64d98f59a4c7 100644
@@ -17,6 +17,7 @@
 #include <asm/arch/mc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
+#include <mach/tegra_gpio.h>
 #include "pinmux-config-nyan-big.h"
 
 /*
board/nvidia/p2371-0000/p2371-0000.c +2 -1
index 0fec3d497d7d..a23dfc8afaef 100644
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <i2c.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "../p2571/max77620_init.h"
 #include "pinmux-config-p2371-0000.h"
 
board/nvidia/p2371-2180/p2371-2180.c +2 -1
index bc3389976942..3989ab8bde32 100644
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <i2c.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "../p2571/max77620_init.h"
 #include "pinmux-config-p2371-2180.h"
 
board/nvidia/p2571/p2571.c +1 -1
index 794830bac3b3..7faec788f3cf 100644
@@ -9,8 +9,8 @@
 #include <i2c.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
-#include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "max77620_init.h"
 #include "pinmux-config-p2571.h"
 
board/nvidia/venice2/venice2.c +2 -1
index 4373de6a26bd..5791e0d73522 100644
@@ -7,8 +7,9 @@
 
 #include <common.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "pinmux-config-venice2.h"
 
 /*
drivers/gpio/tegra_gpio.c +2 -0
index 9abab13daaa9..a3b6878e47bd 100644
@@ -22,6 +22,8 @@
 #include <asm/gpio.h>
 #include <dm/device-internal.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <mach/tegra_gpio.h>
+#include "tegra_gpio_priv.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/gpio/tegra_gpio_priv.h new file +76 -0

76 lines not on this page · raw message

drivers/i2c/tegra_i2c.c +0 -1
index 2a8ab2d5e0b9..f1b8877be228 100644
@@ -14,7 +14,6 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
-#include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <mach/tegra_i2c.h>
Signature · 1 line
2.8.1
#66 lore raw

PATCH 15/60 gpio: tegra: header file split

Hi Stephen,

Quoted 469 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's gpio.h contains a mix of private definitions for use inside the GPIO driver and custom machine-specific APIs. Move the private definitions out of the global include directory since nothing should need to access them. Move the public definitions to the machine-specific include directory <mach/>.

---
 arch/arm/include/asm/arch-tegra114/gpio.h          | 20 ------
 arch/arm/include/asm/arch-tegra124/gpio.h          | 44 -------------
 arch/arm/include/asm/arch-tegra20/gpio.h           | 36 ----------
 arch/arm/include/asm/arch-tegra210/gpio.h          | 44 -------------
 arch/arm/include/asm/arch-tegra30/gpio.h           | 43 ------------
 arch/arm/include/asm/gpio.h                        |  2 +-
 .../include/mach/tegra_gpio.h}                     | 13 +---
 board/nvidia/e2220-1170/e2220-1170.c               |  3 +-
 board/nvidia/jetson-tk1/jetson-tk1.c               |  3 +-
 board/nvidia/nyan-big/nyan-big.c                   |  1 +
 board/nvidia/p2371-0000/p2371-0000.c               |  3 +-
 board/nvidia/p2371-2180/p2371-2180.c               |  3 +-
 board/nvidia/p2571/p2571.c                         |  2 +-
 board/nvidia/venice2/venice2.c                     |  3 +-
 drivers/gpio/tegra_gpio.c                          |  2 +
 drivers/gpio/tegra_gpio_priv.h                     | 76 ++++++++++++++++++++++
 drivers/i2c/tegra_i2c.c                            |  1 -
 17 files changed, 94 insertions(+), 205 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra114/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/gpio.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/gpio.h
 rename arch/arm/{include/asm/arch-tegra/gpio.h => mach-tegra/include/mach/tegra_gpio.h} (67%)
 create mode 100644 drivers/gpio/tegra_gpio_priv.h
arch/arm/include/asm/arch-tegra114/gpio.h deleted +0 -20
deleted file mode 100644
index d6eaa1bd40e8..000000000000
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0
- */
-
-#ifndef _TEGRA114_GPIO_H_
-#define _TEGRA114_GPIO_H_
-
-/*
- * The Tegra114 GPIO controller has 246 GPIOS in 8 banks of 4 ports,
- * each with 8 GPIOs.
- */
-#define TEGRA_GPIO_PORTS       4       /* number of ports per bank */
-#define TEGRA_GPIO_BANKS       8       /* number of banks */
-
-#include <asm/arch-tegra/gpio.h>
-#include <asm/arch-tegra30/gpio.h>
-
-#endif /* _TEGRA114_GPIO_H_ */
arch/arm/include/asm/arch-tegra124/gpio.h deleted +0 -44
deleted file mode 100644
index 8fddb63f44c2..000000000000
@@ -1,44 +0,0 @@
-/*
- * (C) Copyright 2013-2016
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _TEGRA124_GPIO_H_
-#define _TEGRA124_GPIO_H_
-
-/*
- * The Tegra124 GPIO controller has 256 GPIOS in 8 banks of 4 ports,
- * each with 8 GPIOs.
- */
-#define TEGRA_GPIO_PORTS       4       /* number of ports per bank */
-#define TEGRA_GPIO_BANKS       8       /* number of banks */
-
-#include <asm/arch-tegra/gpio.h>
-
-/* GPIO Controller registers for a single bank */
-struct gpio_ctlr_bank {
-       uint gpio_config[TEGRA_GPIO_PORTS];
-       uint gpio_dir_out[TEGRA_GPIO_PORTS];
-       uint gpio_out[TEGRA_GPIO_PORTS];
-       uint gpio_in[TEGRA_GPIO_PORTS];
-       uint gpio_int_status[TEGRA_GPIO_PORTS];
-       uint gpio_int_enable[TEGRA_GPIO_PORTS];
-       uint gpio_int_level[TEGRA_GPIO_PORTS];
-       uint gpio_int_clear[TEGRA_GPIO_PORTS];
-       uint gpio_masked_config[TEGRA_GPIO_PORTS];
-       uint gpio_masked_dir_out[TEGRA_GPIO_PORTS];
-       uint gpio_masked_out[TEGRA_GPIO_PORTS];
-       uint gpio_masked_in[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_status[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_enable[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_level[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_clear[TEGRA_GPIO_PORTS];
-};
-
-struct gpio_ctlr {
-       struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
-};
-
-#endif /* _TEGRA124_GPIO_H_ */
arch/arm/include/asm/arch-tegra20/gpio.h deleted +0 -36
deleted file mode 100644
index 46dcc28f727c..000000000000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011, Google Inc. All rights reserved.
- * Portions Copyright 2011-2016 NVIDIA Corporation
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#ifndef _TEGRA20_GPIO_H_
-#define _TEGRA20_GPIO_H_
-
-/*
- * The Tegra 2x GPIO controller has 224 GPIOs arranged in 7 banks of 4 ports,
- * each with 8 GPIOs.
- */
-#define TEGRA_GPIO_PORTS       4       /* number of ports per bank */
-#define TEGRA_GPIO_BANKS       7       /* number of banks */
-
-#include <asm/arch-tegra/gpio.h>
-
-/* GPIO Controller registers for a single bank */
-struct gpio_ctlr_bank {
-       uint gpio_config[TEGRA_GPIO_PORTS];
-       uint gpio_dir_out[TEGRA_GPIO_PORTS];
-       uint gpio_out[TEGRA_GPIO_PORTS];
-       uint gpio_in[TEGRA_GPIO_PORTS];
-       uint gpio_int_status[TEGRA_GPIO_PORTS];
-       uint gpio_int_enable[TEGRA_GPIO_PORTS];
-       uint gpio_int_level[TEGRA_GPIO_PORTS];
-       uint gpio_int_clear[TEGRA_GPIO_PORTS];
-};
-
-struct gpio_ctlr {
-       struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
-};
-
-#endif /* TEGRA20_GPIO_H_ */
arch/arm/include/asm/arch-tegra210/gpio.h deleted +0 -44
deleted file mode 100644
index f2279d0f3e92..000000000000
@@ -1,44 +0,0 @@
-/*
- * (C) Copyright 2013-2016
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _TEGRA210_GPIO_H_
-#define _TEGRA210_GPIO_H_
-
-/*
- * The Tegra210 GPIO controller has 256 GPIOS in 8 banks of 4 ports,
- * each with 8 GPIOs.
- */
-#define TEGRA_GPIO_PORTS       4       /* number of ports per bank */
-#define TEGRA_GPIO_BANKS       8       /* number of banks */
-
-#include <asm/arch-tegra/gpio.h>
-
-/* GPIO Controller registers for a single bank */
-struct gpio_ctlr_bank {
-       uint gpio_config[TEGRA_GPIO_PORTS];
-       uint gpio_dir_out[TEGRA_GPIO_PORTS];
-       uint gpio_out[TEGRA_GPIO_PORTS];
-       uint gpio_in[TEGRA_GPIO_PORTS];
-       uint gpio_int_status[TEGRA_GPIO_PORTS];
-       uint gpio_int_enable[TEGRA_GPIO_PORTS];
-       uint gpio_int_level[TEGRA_GPIO_PORTS];
-       uint gpio_int_clear[TEGRA_GPIO_PORTS];
-       uint gpio_masked_config[TEGRA_GPIO_PORTS];
-       uint gpio_masked_dir_out[TEGRA_GPIO_PORTS];
-       uint gpio_masked_out[TEGRA_GPIO_PORTS];
-       uint gpio_masked_in[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_status[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_enable[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_level[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_clear[TEGRA_GPIO_PORTS];
-};
-
-struct gpio_ctlr {
-       struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
-};
-
-#endif /* _TEGRA210_GPIO_H_ */
arch/arm/include/asm/arch-tegra30/gpio.h deleted +0 -43
deleted file mode 100644
index 288451df2ff6..000000000000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0
- */
-
-#ifndef _TEGRA30_GPIO_H_
-#define _TEGRA30_GPIO_H_
-
-/*
- * The Tegra 3x GPIO controller has 246 GPIOS in 8 banks of 4 ports,
- * each with 8 GPIOs.
- */
-#define TEGRA_GPIO_PORTS       4       /* number of ports per bank */
-#define TEGRA_GPIO_BANKS       8       /* number of banks */
-
-#include <asm/arch-tegra/gpio.h>
-
-/* GPIO Controller registers for a single bank */
-struct gpio_ctlr_bank {
-       uint gpio_config[TEGRA_GPIO_PORTS];
-       uint gpio_dir_out[TEGRA_GPIO_PORTS];
-       uint gpio_out[TEGRA_GPIO_PORTS];
-       uint gpio_in[TEGRA_GPIO_PORTS];
-       uint gpio_int_status[TEGRA_GPIO_PORTS];
-       uint gpio_int_enable[TEGRA_GPIO_PORTS];
-       uint gpio_int_level[TEGRA_GPIO_PORTS];
-       uint gpio_int_clear[TEGRA_GPIO_PORTS];
-       uint gpio_masked_config[TEGRA_GPIO_PORTS];
-       uint gpio_masked_dir_out[TEGRA_GPIO_PORTS];
-       uint gpio_masked_out[TEGRA_GPIO_PORTS];
-       uint gpio_masked_in[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_status[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_enable[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_level[TEGRA_GPIO_PORTS];
-       uint gpio_masked_int_clear[TEGRA_GPIO_PORTS];
-};
-
-struct gpio_ctlr {
-       struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
-};
-
-#endif /* _TEGRA30_GPIO_H_ */
arch/arm/include/asm/gpio.h +1 -1
index fe4419cae4cf..751a5ade17c7 100644
@@ -1,4 +1,4 @@
-#ifndef CONFIG_ARCH_UNIPHIER
+#if !defined(CONFIG_ARCH_UNIPHIER) && !defined(CONFIG_TEGRA)
 #include <asm/arch/gpio.h>
 #endif
 #include <asm-generic/gpio.h>
arch/arm/mach-tegra/include/mach/tegra_gpio.h renamed from arch/arm/include/asm/arch-tegra/gpio.h +3 -10
similarity index 67%
rename from arch/arm/include/asm/arch-tegra/gpio.h
rename to arch/arm/mach-tegra/include/mach/tegra_gpio.h
index 07921f34b9d7..09b813bc79ac 100644
@@ -5,15 +5,8 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#ifndef _TEGRA_GPIO_H_
-#define _TEGRA_GPIO_H_
-
-#define TEGRA_GPIOS_PER_PORT   8
-
-#define GPIO_BANK(x)           ((x) >> 5)
-#define GPIO_PORT(x)           (((x) >> 3) & 0x3)
-#define GPIO_FULLPORT(x)       ((x) >> 3)
-#define GPIO_BIT(x)            ((x) & 0x7)
+#ifndef _MACH_TEGRA_GPIO_H
+#define _MACH_TEGRA_GPIO_H
 
 enum tegra_gpio_init {
        TEGRA_GPIO_INIT_IN,
@@ -34,4 +27,4 @@ struct tegra_gpio_config {
  */
 void gpio_config_table(const struct tegra_gpio_config *config, int len);
 
-#endif /* TEGRA_GPIO_H_ */
+#endif
board/nvidia/e2220-1170/e2220-1170.c +2 -1
index db6fa74ae1fe..c2b5e5e09d21 100644
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <i2c.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "../p2571/max77620_init.h"
 #include "pinmux-config-e2220-1170.h"
 
board/nvidia/jetson-tk1/jetson-tk1.c +2 -1
index 4b7058e3bc89..422a18a4e530 100644
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
 #include <power/as3722.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "pinmux-config-jetson-tk1.h"
 
 DECLARE_GLOBAL_DATA_PTR;
board/nvidia/nyan-big/nyan-big.c +1 -0
index 56e15bda93ec..64d98f59a4c7 100644
@@ -17,6 +17,7 @@
 #include <asm/arch/mc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
+#include <mach/tegra_gpio.h>
 #include "pinmux-config-nyan-big.h"
 
 /*
board/nvidia/p2371-0000/p2371-0000.c +2 -1
index 0fec3d497d7d..a23dfc8afaef 100644
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <i2c.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "../p2571/max77620_init.h"
 #include "pinmux-config-p2371-0000.h"
 
board/nvidia/p2371-2180/p2371-2180.c +2 -1
index bc3389976942..3989ab8bde32 100644
@@ -8,8 +8,9 @@
 #include <common.h>
 #include <i2c.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "../p2571/max77620_init.h"
 #include "pinmux-config-p2371-2180.h"
 
board/nvidia/p2571/p2571.c +1 -1
index 794830bac3b3..7faec788f3cf 100644
@@ -9,8 +9,8 @@
 #include <i2c.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
-#include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "max77620_init.h"
 #include "pinmux-config-p2571.h"
 
board/nvidia/venice2/venice2.c +2 -1
index 4373de6a26bd..5791e0d73522 100644
@@ -7,8 +7,9 @@
 
 #include <common.h>
 #include <dt-bindings/gpio/tegra-gpio.h>
-#include <asm/arch/gpio.h>
+#include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
+#include <mach/tegra_gpio.h>
 #include "pinmux-config-venice2.h"
 
 /*
drivers/gpio/tegra_gpio.c +2 -0
index 9abab13daaa9..a3b6878e47bd 100644
@@ -22,6 +22,8 @@
 #include <asm/gpio.h>
 #include <dm/device-internal.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <mach/tegra_gpio.h>
+#include "tegra_gpio_priv.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/gpio/tegra_gpio_priv.h new file +55 -0
new file mode 100644
index 000000000000..edf5540da72f
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2011, Google Inc. All rights reserved.
+ * Copyright 2011-2016 NVIDIA Corporation
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _TEGRA_GPIO_PRIV_H
+#define _TEGRA_GPIO_PRIV_H
+
+/*
+ * GPIOs are arranged into ports, each of which controls 8 GPIOs.
+ *
+ * Ports are aggregated into banks (U-Boot terminology used below) or
+ * "controllers" (Tegra TRM terminology) each containing 4 ports.
+ *
+ * Banks/controllers are aggregated into the overall GPIO controller hardware
+ * module. Tegra20 implements only 7 banks. However, the register location of
+ * the "masked" registers is designed to leave space for 8 banks. Tegra30 and
+ * onwards implement 8 banks. In many cases, the last bank contains ports
+ * and/or GPIOs that are not implemented, or at least not connected to any
+ * pad/pin.
+ */
+#define TEGRA_GPIO_BANKS       8       /* number of banks */
+#define TEGRA_GPIO_PORTS       4       /* number of ports per bank */
+#define TEGRA_GPIOS_PER_PORT   8
+
+#define GPIO_BANK(x)           ((x) >> 5)
+#define GPIO_PORT(x)           (((x) >> 3) & 0x3)
+#define GPIO_FULLPORT(x)       ((x) >> 3)
+#define GPIO_BIT(x)            ((x) & 0x7)
+
+/*
+ * GPIO registers are split into two chunks; low and high.
+ * On Tegra20, all low chunks appear first, then all high chunks.
+ * In later SoCs, the low and high chunks are interleaved together.
+ */
+#define GPIO_CTLR_BANK_HIGH_REGS \
+       uint gpio_masked_config[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_dir_out[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_out[TEGRA_GPIO_PORTS]; \
+       uint reserved0[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_status[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_enable[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_level[TEGRA_GPIO_PORTS]; \
+       uint reserved1[TEGRA_GPIO_PORTS];
+
+/* GPIO Controller registers for a single bank */
+struct gpio_ctlr_bank {
+       uint gpio_config[TEGRA_GPIO_PORTS];
+       uint gpio_dir_out[TEGRA_GPIO_PORTS];
+       uint gpio_out[TEGRA_GPIO_PORTS];
+       uint gpio_in[TEGRA_GPIO_PORTS];
+       uint gpio_int_status[TEGRA_GPIO_PORTS];
+       uint gpio_int_enable[TEGRA_GPIO_PORTS];

drivers/gpio/tegra_gpio_priv.h line 65

Quoted 10 lines
drivers/gpio/tegra_gpio_priv.h new file +10 -0
+       uint gpio_int_level[TEGRA_GPIO_PORTS];
+       uint gpio_int_clear[TEGRA_GPIO_PORTS];
+#ifndef CONFIG_TEGRA20
+       GPIO_CTLR_BANK_HIGH_REGS
+#endif
+};
+
+#ifdef CONFIG_TEGRA20
+struct gpio_ctlr_bank_high {
+       GPIO_CTLR_BANK_HIGH_REGS

This seems a bit ugly. Perhaps you could havestruct gpio_ctlr_high_regs and include that here? It adds a level of indirection but that doesn't seem very important.

Quoted 24 lines
drivers/gpio/tegra_gpio_priv.h new file +11 -0
+};
+#endif
+
+struct gpio_ctlr {
+       struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
+#ifdef CONFIG_TEGRA20
+       struct gpio_ctlr_bank_high gpio_bank_high[TEGRA_GPIO_BANKS];
+#endif
+};
+
+#endif
drivers/i2c/tegra_i2c.c +0 -2
index 2a8ab2d5e0b9..f1b8877be228 100644
@@ -14,7 +14,6 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
-#include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <mach/tegra_i2c.h>
--
Quoted 2 lines

2.8.1

Regards,
Simon

#67 lore raw

PATCH 15/60 gpio: tegra: header file split

Quoted 42 lines · Simon Glass

Hi Stephen,

Quoted 39 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's gpio.h contains a mix of private definitions for use inside the GPIO driver and custom machine-specific APIs. Move the private definitions out of the global include directory since nothing should need to access them. Move the public definitions to the machine-specific include directory <mach/>.

drivers/gpio/tegra_gpio_priv.h +29 -0
 
+/*
+ * GPIO registers are split into two chunks; low and high.
+ * On Tegra20, all low chunks appear first, then all high chunks.
+ * In later SoCs, the low and high chunks are interleaved together.
+ */
+#define GPIO_CTLR_BANK_HIGH_REGS \
+       uint gpio_masked_config[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_dir_out[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_out[TEGRA_GPIO_PORTS]; \
+       uint reserved0[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_status[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_enable[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_level[TEGRA_GPIO_PORTS]; \
+       uint reserved1[TEGRA_GPIO_PORTS];
+
+/* GPIO Controller registers for a single bank */
+struct gpio_ctlr_bank {
+       uint gpio_config[TEGRA_GPIO_PORTS];
+       uint gpio_dir_out[TEGRA_GPIO_PORTS];
+       uint gpio_out[TEGRA_GPIO_PORTS];
+       uint gpio_in[TEGRA_GPIO_PORTS];
+       uint gpio_int_status[TEGRA_GPIO_PORTS];
+       uint gpio_int_enable[TEGRA_GPIO_PORTS];
+       uint gpio_int_level[TEGRA_GPIO_PORTS];
+       uint gpio_int_clear[TEGRA_GPIO_PORTS];
+#ifndef CONFIG_TEGRA20
+       GPIO_CTLR_BANK_HIGH_REGS
+#endif
+};
Quoted 8 lines

drivers/gpio/tegra_gpio_priv.h line 65

Quoted 4 lines
drivers/gpio/tegra_gpio_priv.h +4 -0
+
+#ifdef CONFIG_TEGRA20
+struct gpio_ctlr_bank_high {
+       GPIO_CTLR_BANK_HIGH_REGS

This seems a bit ugly. Perhaps you could havestruct gpio_ctlr_high_regs and include that here? It adds a level of indirection but that doesn't seem very important.

In newer Tegras, there's no differentiation between the two register sets that were "low" and "high" in Tegra20. I'd rather not saddle the non-Tegra20 struct layouts with some odd naming/nesting just because the Tegra20 layout was odd. I don't see any problem with using a #define for this; it doesn't seem to make the code complex.

I wonder if we should just convert away from structs for registers entirely. Everything in the HW docs is just numbers, matching those to the structs is always painful, and if we used #defines instead of structs, representing this HW difference would end up being much cleaner and avoid using a macro to "cut/paste" a register list 2 times; see the way the Linux kernel driver handles this.

#68 lore raw

PATCH 15/60 gpio: tegra: header file split

Hi Stephen,

Quoted 60 lines · Stephen Warren
Quoted 49 lines · Simon Glass

Hi Stephen,

Quoted 45 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's gpio.h contains a mix of private definitions for use inside the GPIO driver and custom machine-specific APIs. Move the private definitions
out of the global include directory since nothing should need to access them. Move the public definitions to the machine-specific include directory <mach/>.

drivers/gpio/tegra_gpio_priv.h +30 -0
 
 
+/*
+ * GPIO registers are split into two chunks; low and high.
+ * On Tegra20, all low chunks appear first, then all high chunks.
+ * In later SoCs, the low and high chunks are interleaved together.
+ */
+#define GPIO_CTLR_BANK_HIGH_REGS \
+       uint gpio_masked_config[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_dir_out[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_out[TEGRA_GPIO_PORTS]; \
+       uint reserved0[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_status[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_enable[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_level[TEGRA_GPIO_PORTS]; \
+       uint reserved1[TEGRA_GPIO_PORTS];
+
+/* GPIO Controller registers for a single bank */
+struct gpio_ctlr_bank {
+       uint gpio_config[TEGRA_GPIO_PORTS];
+       uint gpio_dir_out[TEGRA_GPIO_PORTS];
+       uint gpio_out[TEGRA_GPIO_PORTS];
+       uint gpio_in[TEGRA_GPIO_PORTS];
+       uint gpio_int_status[TEGRA_GPIO_PORTS];
+       uint gpio_int_enable[TEGRA_GPIO_PORTS];
+       uint gpio_int_level[TEGRA_GPIO_PORTS];
+       uint gpio_int_clear[TEGRA_GPIO_PORTS];
+#ifndef CONFIG_TEGRA20
+       GPIO_CTLR_BANK_HIGH_REGS
+#endif
+};
+
Quoted 8 lines

drivers/gpio/tegra_gpio_priv.h line 65

Quoted 3 lines
drivers/gpio/tegra_gpio_priv.h +3 -0
+#ifdef CONFIG_TEGRA20
+struct gpio_ctlr_bank_high {
+       GPIO_CTLR_BANK_HIGH_REGS

This seems a bit ugly. Perhaps you could havestruct gpio_ctlr_high_regs and include that here? It adds a level of indirection but that doesn't seem very important.

Quoted 5 lines

In newer Tegras, there's no differentiation between the two register sets that were "low" and "high" in Tegra20. I'd rather not saddle the non-Tegra20 struct layouts with some odd naming/nesting just because the Tegra20 layout was odd. I don't see any problem with using a #define for this; it doesn't seem to make the code complex.

OK, well then how about just duplicating the two structs, and dropping the #define?

#ifdfef CONFIG_TEGRA20
struct gpio_ctlr_bank {

};
#else
struct gpio_ctlr_bank {
};
#endif

Quoted 6 lines

I wonder if we should just convert away from structs for registers entirely. Everything in the HW docs is just numbers, matching those to the structs is always painful, and if we used #defines instead of structs, representing this HW difference would end up being much cleaner and avoid using a macro to "cut/paste" a register list 2 times; see the way the Linux kernel driver handles this.

Structs are definitely easier to read and particularly in this case where each struct element is an array.

Why are you worried about code duplication in a header file?

Regards,
Simon

#69 lore raw

PATCH 15/60 gpio: tegra: header file split

Quoted 72 lines · Simon Glass

Hi Stephen,

Quoted 60 lines · Stephen Warren
Quoted 49 lines · Simon Glass

Hi Stephen,

Quoted 45 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's gpio.h contains a mix of private definitions for use inside the GPIO driver and custom machine-specific APIs. Move the private definitions
out of the global include directory since nothing should need to access them. Move the public definitions to the machine-specific include directory <mach/>.

drivers/gpio/tegra_gpio_priv.h +30 -0
 
 
+/*
+ * GPIO registers are split into two chunks; low and high.
+ * On Tegra20, all low chunks appear first, then all high chunks.
+ * In later SoCs, the low and high chunks are interleaved together.
+ */
+#define GPIO_CTLR_BANK_HIGH_REGS \
+       uint gpio_masked_config[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_dir_out[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_out[TEGRA_GPIO_PORTS]; \
+       uint reserved0[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_status[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_enable[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_level[TEGRA_GPIO_PORTS]; \
+       uint reserved1[TEGRA_GPIO_PORTS];
+
+/* GPIO Controller registers for a single bank */
+struct gpio_ctlr_bank {
+       uint gpio_config[TEGRA_GPIO_PORTS];
+       uint gpio_dir_out[TEGRA_GPIO_PORTS];
+       uint gpio_out[TEGRA_GPIO_PORTS];
+       uint gpio_in[TEGRA_GPIO_PORTS];
+       uint gpio_int_status[TEGRA_GPIO_PORTS];
+       uint gpio_int_enable[TEGRA_GPIO_PORTS];
+       uint gpio_int_level[TEGRA_GPIO_PORTS];
+       uint gpio_int_clear[TEGRA_GPIO_PORTS];
+#ifndef CONFIG_TEGRA20
+       GPIO_CTLR_BANK_HIGH_REGS
+#endif
+};
+
Quoted 8 lines

drivers/gpio/tegra_gpio_priv.h line 65

Quoted 3 lines
drivers/gpio/tegra_gpio_priv.h +3 -0
+#ifdef CONFIG_TEGRA20
+struct gpio_ctlr_bank_high {
+       GPIO_CTLR_BANK_HIGH_REGS

This seems a bit ugly. Perhaps you could havestruct gpio_ctlr_high_regs and include that here? It adds a level of indirection but that doesn't seem very important.

Quoted 5 lines

In newer Tegras, there's no differentiation between the two register sets that were "low" and "high" in Tegra20. I'd rather not saddle the non-Tegra20 struct layouts with some odd naming/nesting just because the Tegra20 layout was odd. I don't see any problem with using a #define for this; it doesn't seem to make the code complex.

OK, well then how about just duplicating the two structs, and dropping the #define?

Quoted 8 lines

#ifdfef CONFIG_TEGRA20
struct gpio_ctlr_bank {

};
#else
struct gpio_ctlr_bank {
};
#endif

Given that the driver doesn't use any registers in the high bank, and indeed can't; the driver's reliance on structs rather than register defines means that the high bank registers would have to be accessed differently between Tegra20 and other SoCs, I propose simply not representing those registers. Instead, how about:

struct gpio_ctlr_bank {
	uint gpio_config[TEGRA_GPIO_PORTS];
	uint gpio_dir_out[TEGRA_GPIO_PORTS];
	uint gpio_out[TEGRA_GPIO_PORTS];
	uint gpio_in[TEGRA_GPIO_PORTS];
	uint gpio_int_status[TEGRA_GPIO_PORTS];
	uint gpio_int_enable[TEGRA_GPIO_PORTS];
	uint gpio_int_level[TEGRA_GPIO_PORTS];
	uint gpio_int_clear[TEGRA_GPIO_PORTS];
#ifndef CONFIG_TEGRA20
	uint unused[TEGRA_GPIO_PORTS * 8];

#endif
};

struct gpio_ctlr {
	struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
};

That removes all the duplication, without any macros etc.

Does that look reasonable? If I fixup the patch like that, I'll add a brief comment describing what the unused registers are, similar to the one in patch v1.

Quoted 9 lines
Quoted 6 lines

I wonder if we should just convert away from structs for registers entirely. Everything in the HW docs is just numbers, matching those to the structs is always painful, and if we used #defines instead of structs, representing this HW difference would end up being much cleaner and avoid using a macro to "cut/paste" a register list 2 times; see the way the Linux kernel driver handles this.

Structs are definitely easier to read and particularly in this case where each struct element is an array.

I'm not really sure there's much objective difference between the readability of the two. Arrays can easily be abstracted via a macro or inline function so that the call site looks essentially identical; () vs [].

Quoted 1 line

Why are you worried about code duplication in a header file?

I'm not sure why I would special case my concerns and ignore duplication in certain locations yet still care about duplication in general or elsewhere?

#70 lore raw

PATCH 15/60 gpio: tegra: header file split

Hi Stephen,

Quoted 119 lines · Stephen Warren
Quoted 84 lines · Simon Glass

Hi Stephen,

Quoted 67 lines · Stephen Warren
Quoted 54 lines · Simon Glass

Hi Stephen,

Quoted 49 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Tegra's gpio.h contains a mix of private definitions for use inside the GPIO driver and custom machine-specific APIs. Move the private definitions
out of the global include directory since nothing should need to access them. Move the public definitions to the machine-specific include directory <mach/>.

drivers/gpio/tegra_gpio_priv.h +31 -0
 
 
 
+/*
+ * GPIO registers are split into two chunks; low and high.
+ * On Tegra20, all low chunks appear first, then all high chunks.
+ * In later SoCs, the low and high chunks are interleaved together.
+ */
+#define GPIO_CTLR_BANK_HIGH_REGS \
+       uint gpio_masked_config[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_dir_out[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_out[TEGRA_GPIO_PORTS]; \
+       uint reserved0[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_status[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_enable[TEGRA_GPIO_PORTS]; \
+       uint gpio_masked_int_level[TEGRA_GPIO_PORTS]; \
+       uint reserved1[TEGRA_GPIO_PORTS];
+
+/* GPIO Controller registers for a single bank */
+struct gpio_ctlr_bank {
+       uint gpio_config[TEGRA_GPIO_PORTS];
+       uint gpio_dir_out[TEGRA_GPIO_PORTS];
+       uint gpio_out[TEGRA_GPIO_PORTS];
+       uint gpio_in[TEGRA_GPIO_PORTS];
+       uint gpio_int_status[TEGRA_GPIO_PORTS];
+       uint gpio_int_enable[TEGRA_GPIO_PORTS];
+       uint gpio_int_level[TEGRA_GPIO_PORTS];
+       uint gpio_int_clear[TEGRA_GPIO_PORTS];
+#ifndef CONFIG_TEGRA20
+       GPIO_CTLR_BANK_HIGH_REGS
+#endif
+};
+
+#ifdef CONFIG_TEGRA20
Quoted 8 lines

drivers/gpio/tegra_gpio_priv.h line 65

Quoted 2 lines
drivers/gpio/tegra_gpio_priv.h +2 -0
+struct gpio_ctlr_bank_high {
+       GPIO_CTLR_BANK_HIGH_REGS

This seems a bit ugly. Perhaps you could havestruct gpio_ctlr_high_regs and include that here? It adds a level of indirection but that doesn't seem very important.

Quoted 8 lines

In newer Tegras, there's no differentiation between the two register sets that were "low" and "high" in Tegra20. I'd rather not saddle the non-Tegra20
struct layouts with some odd naming/nesting just because the Tegra20 layout
was odd. I don't see any problem with using a #define for this; it doesn't
seem to make the code complex.

OK, well then how about just duplicating the two structs, and dropping the #define?

Quoted 8 lines

#ifdfef CONFIG_TEGRA20
struct gpio_ctlr_bank {

};
#else
struct gpio_ctlr_bank {
};
#endif

Given that the driver doesn't use any registers in the high bank, and indeed can't; the driver's reliance on structs rather than register defines means that the high bank registers would have to be accessed differently between Tegra20 and other SoCs, I propose simply not representing those registers. Instead, how about:

struct gpio_ctlr_bank {
        uint gpio_config[TEGRA_GPIO_PORTS];
        uint gpio_dir_out[TEGRA_GPIO_PORTS];
        uint gpio_out[TEGRA_GPIO_PORTS];
        uint gpio_in[TEGRA_GPIO_PORTS];
        uint gpio_int_status[TEGRA_GPIO_PORTS];
        uint gpio_int_enable[TEGRA_GPIO_PORTS];
        uint gpio_int_level[TEGRA_GPIO_PORTS];
        uint gpio_int_clear[TEGRA_GPIO_PORTS];
#ifndef CONFIG_TEGRA20
        uint unused[TEGRA_GPIO_PORTS * 8];

#endif
};

struct gpio_ctlr {
        struct gpio_ctlr_bank gpio_bank[TEGRA_GPIO_BANKS];
};
Quoted 5 lines

That removes all the duplication, without any macros etc.

Does that look reasonable? If I fixup the patch like that, I'll add a brief comment describing what the unused registers are, similar to the one in patch v1.

SGTM

Quoted 13 lines
Quoted 13 lines
Quoted 11 lines

I wonder if we should just convert away from structs for registers entirely.
Everything in the HW docs is just numbers, matching those to the structs is
always painful, and if we used #defines instead of structs, representing this HW difference would end up being much cleaner and avoid using a macro
to "cut/paste" a register list 2 times; see the way the Linux kernel driver
handles this.

Quoted 7 lines
Quoted 2 lines

Structs are definitely easier to read and particularly in this case where each struct element is an array.

I'm not really sure there's much objective difference between the readability of the two. Arrays can easily be abstracted via a macro or inline function so that the call site looks essentially identical; () vs [].

IMO the code is much harder to follow when you need to look up macros, etc. C already supports arrays :-)

Quoted 6 lines
Quoted 2 lines

Why are you worried about code duplication in a header file?

I'm not sure why I would special case my concerns and ignore duplication in certain locations yet still care about duplication in general or elsewhere?

We commonly put ugliness in header files. So long as the resulting syntax (in C files) is pretty obvious and non-surprising, this makes sense. Most of the time these header files are ignored by humans when reading the code since it is pretty obvious from the C code what is going on.

Examples include static inline to drop functions, hardware register definitions, bitfield definitions, #ifdef setup (see image.h), etc.

Perhaps by that argument your original #define scheme is fine. I don't like things that make it hard to grep the code for stuff, but this is minor. So I'm going to withdraw my objection (sorry).

Regards,
Simon

#71 lore raw

PATCH 16/60 ARM: tegra: migrate TEGRA_GPIO to Kconfig

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

All configuration is migrating to Kconfig. This moves one piece.

TEGRA_GPIO is default y since it's almost certain to be needed, and this setting matches the stanza removed from the config header file.

CONFIG_HAS_TEGRA_GPIO is introduced so that drivers/gpio/Kconfig doesn't have to know which Tegra chips contain this GPIO controller, thus isolating such knowledge into mach-tegra/Kconfig. All currently supported chips do, but the next chip contains a different GPIO controller and hence requires a different driver.

---
 arch/arm/mach-tegra/Kconfig    | 5 +++++
 drivers/gpio/Kconfig           | 8 ++++++++
 include/configs/tegra-common.h | 1 -
 3 files changed, 13 insertions(+), 1 deletion(-)
arch/arm/mach-tegra/Kconfig +5 -0
index ba6983f3dfd3..32ea2f944fa9 100644
@@ -1,5 +1,8 @@
 if TEGRA
 
+config HAS_TEGRA_GPIO
+	bool "SoC contains Tegra20..210 GPIO controller"
+
 config TEGRA_COMMON
 	bool "Tegra common options"
 	select DM
@@ -19,6 +22,7 @@ config TEGRA_COMMON
 config TEGRA_ARMV7_COMMON
 	bool "Tegra 32-bit common options"
 	select CPU_V7
+	select HAS_TEGRA_GPIO
 	select SPL
 	select SUPPORT_SPL
 	select TEGRA_COMMON
@@ -50,6 +54,7 @@ config TEGRA124
 
 config TEGRA210
 	bool "Tegra210 family"
+	select HAS_TEGRA_GPIO
 	select TEGRA_ARMV8_COMMON
 
 endchoice
drivers/gpio/Kconfig +8 -0
index f56a60621ff0..85700922a2da 100644
@@ -109,6 +109,14 @@ config SANDBOX_GPIO_COUNT
 	  of 'anonymous' GPIOs that do not belong to any device or bank.
 	  Select a suitable value depending on your needs.
 
+config TEGRA_GPIO
+	bool "Tegra20..210 GPIO driver"
+	depends on DM_GPIO && HAS_TEGRA_GPIO
+	default y
+	help
+	  Support for the GPIO controller contained in NVIDIA Tegra20 through
+	  Tegra210.
+
 config GPIO_UNIPHIER
 	bool "UniPhier GPIO"
 	depends on ARCH_UNIPHIER
include/configs/tegra-common.h +0 -1
index 776394151661..b6506e2fb3df 100644
@@ -109,7 +109,6 @@
 						CONFIG_SYS_INIT_RAM_SIZE - \
 						GENERATED_GBL_DATA_SIZE)
 
-#define CONFIG_TEGRA_GPIO
 #define CONFIG_CMD_ENTERRCM
 
 /* Defines for SPL */
Signature · 1 line
2.8.1
#72 lore raw

PATCH 16/60 ARM: tegra: migrate TEGRA_GPIO to Kconfig

Quoted 13 lines · Stephen Warren

From: Stephen Warren <[email protected]>

All configuration is migrating to Kconfig. This moves one piece.

TEGRA_GPIO is default y since it's almost certain to be needed, and this setting matches the stanza removed from the config header file.

CONFIG_HAS_TEGRA_GPIO is introduced so that drivers/gpio/Kconfig doesn't have to know which Tegra chips contain this GPIO controller, thus isolating such knowledge into mach-tegra/Kconfig. All currently supported chips do, but the next chip contains a different GPIO controller and hence requires a different driver.

Quoted 6 lines
---
 arch/arm/mach-tegra/Kconfig    | 5 +++++
 drivers/gpio/Kconfig           | 8 ++++++++
 include/configs/tegra-common.h | 1 -
 3 files changed, 13 insertions(+), 1 deletion(-)
#73 lore raw

PATCH 17/60 ARM: tegra: move apb_misc.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra/, so move it there to avoid polluting the global include path.

---
 arch/arm/{include/asm/arch-tegra => mach-tegra}/apb_misc.h | 5 +++--
 arch/arm/mach-tegra/spl.c                                  | 4 ++--
 arch/arm/mach-tegra/tegra20/emc.c                          | 2 +-
 arch/arm/mach-tegra/tegra20/warmboot.c                     | 2 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.c                 | 2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/apb_misc.h (79%)
arch/arm/mach-tegra/apb_misc.h renamed from arch/arm/include/asm/arch-tegra/apb_misc.h +3 -2
similarity index 79%
rename from arch/arm/include/asm/arch-tegra/apb_misc.h
rename to arch/arm/mach-tegra/apb_misc.h
index a5bc092ffdc1..8622826172e9 100644
@@ -1,11 +1,12 @@
 /*
  * Copyright (c) 2012 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _GP_PADCTRL_H_
-#define _GP_PADCTRL_H_
+#ifndef _TEGRA_APB_MISC_H
+#define _TEGRA_APB_MISC_H
 
 /* APB_MISC_PP registers */
 struct apb_misc_pp_ctlr {
arch/arm/mach-tegra/spl.c +2 -2
index e0f9d5b6b4e9..ad13ad5ba5fb 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2012
+ * (C) Copyright 2012-2016
  * NVIDIA Inc, <www.nvidia.com>
  *
  * Allen Martin <[email protected]>
@@ -13,9 +13,9 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/spl.h>
+#include "apb_misc.h"
 #include "cpu.h"
 
 void spl_board_init(void)
arch/arm/mach-tegra/tegra20/emc.c +1 -1
index eab61b7cd2ab..ace5fb5aa758 100644
@@ -8,10 +8,10 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <asm/io.h>
-#include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
 #include <asm/arch/tegra.h>
+#include "../apb_misc.h"
 
 /*
  * The EMC registers have shadow registers.  When the EMC clock is updated
arch/arm/mach-tegra/tegra20/warmboot.c +1 -1
index 1013441d4265..427af25032bc 100644
@@ -14,11 +14,11 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/sdram_param.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/fuse.h>
 #include <asm/arch-tegra/warmboot.h>
+#include "../apb_misc.h"
 #include "crypto.h"
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/mach-tegra/tegra20/warmboot_avp.c +1 -1
index 616358b657be..0ae401c569b6 100644
@@ -11,10 +11,10 @@
 #include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/warmboot.h>
+#include "../apb_misc.h"
 #include "../cpu.h"
 #include "warmboot_avp.h"
 
Signature · 1 line
2.8.1
#74 lore raw

PATCH 17/60 ARM: tegra: move apb_misc.h

Hi Stephen,

Quoted 97 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra/, so move it there to avoid polluting the global include path.

---
 arch/arm/{include/asm/arch-tegra => mach-tegra}/apb_misc.h | 5 +++--
 arch/arm/mach-tegra/spl.c                                  | 4 ++--
 arch/arm/mach-tegra/tegra20/emc.c                          | 2 +-
 arch/arm/mach-tegra/tegra20/warmboot.c                     | 2 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.c                 | 2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/apb_misc.h (79%)
arch/arm/mach-tegra/apb_misc.h renamed from arch/arm/include/asm/arch-tegra/apb_misc.h +3 -2
similarity index 79%
rename from arch/arm/include/asm/arch-tegra/apb_misc.h
rename to arch/arm/mach-tegra/apb_misc.h
index a5bc092ffdc1..8622826172e9 100644
@@ -1,11 +1,12 @@
 /*
  * Copyright (c) 2012 The Chromium OS Authors.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#ifndef _GP_PADCTRL_H_
-#define _GP_PADCTRL_H_
+#ifndef _TEGRA_APB_MISC_H
+#define _TEGRA_APB_MISC_H
 
 /* APB_MISC_PP registers */
 struct apb_misc_pp_ctlr {
arch/arm/mach-tegra/spl.c +2 -2
index e0f9d5b6b4e9..ad13ad5ba5fb 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2012
+ * (C) Copyright 2012-2016
  * NVIDIA Inc, <www.nvidia.com>
  *
  * Allen Martin <[email protected]>
@@ -13,9 +13,9 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/spl.h>
+#include "apb_misc.h"
 #include "cpu.h"
 
 void spl_board_init(void)
arch/arm/mach-tegra/tegra20/emc.c +1 -1
index eab61b7cd2ab..ace5fb5aa758 100644
@@ -8,10 +8,10 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <asm/io.h>
-#include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
 #include <asm/arch/tegra.h>
+#include "../apb_misc.h"
 
 /*
  * The EMC registers have shadow registers.  When the EMC clock is updated
arch/arm/mach-tegra/tegra20/warmboot.c +1 -1
index 1013441d4265..427af25032bc 100644
@@ -14,11 +14,11 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/sdram_param.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/fuse.h>
 #include <asm/arch-tegra/warmboot.h>
+#include "../apb_misc.h"
 #include "crypto.h"
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/mach-tegra/tegra20/warmboot_avp.c +0 -0
index 616358b657be..0ae401c569b6 100644

arch/arm/mach-tegra/tegra20/warmboot_avp.c line 17

Quoted 8 lines
arch/arm/mach-tegra/tegra20/warmboot_avp.c +1 -1
@@ -11,10 +11,10 @@
 #include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/apb_misc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/warmboot.h>
+#include "../apb_misc.h"

Is this really an improvement? What's the rationale?

Quoted 6 lines
arch/arm/mach-tegra/tegra20/warmboot_avp.c +0 -1
 #include "../cpu.h"
 #include "warmboot_avp.h"
 
--

2.8.1

Regards,
Simon

#75 lore raw

PATCH 17/60 ARM: tegra: move apb_misc.h

Quoted 8 lines · Simon Glass

Hi Stephen,

Quoted 4 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra/, so move it there to avoid polluting the global include path.

Quoted 15 lines

arch/arm/mach-tegra/tegra20/warmboot_avp.c line 17

Quoted 13 lines
arch/arm/mach-tegra/tegra20/warmboot_avp.c +1 -1
index 616358b657be..0ae401c569b6 100644
@@ -11,10 +11,10 @@
  #include <asm/arch/flow.h>
  #include <asm/arch/pinmux.h>
  #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/apb_misc.h>
  #include <asm/arch-tegra/clk_rst.h>
  #include <asm/arch-tegra/pmc.h>
  #include <asm/arch-tegra/warmboot.h>
+#include "../apb_misc.h"

Is this really an improvement?

Yes:-P

Quoted 1 line

What's the rationale?

As mentioned in the commit description, the content of the header is only used by code in arch/arm/mach-tegra/. By moving the header file out of a directory that's part of the include path, we ensure that code (such as drivers and core code) can't access the header without explicitly doing something unusual, which should ring alarm bells. This will help avoid future additions of code that touches Tegra internals rather than accessing functionality through standard/generic (or even custom but explicitly "exported") APIs.

#76 lore raw

PATCH 17/60 ARM: tegra: move apb_misc.h

Hi Stephen,

Quoted 36 lines · Stephen Warren
Quoted 20 lines · Simon Glass

Hi Stephen,

Quoted 16 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra/, so move it there to avoid polluting the global include path.

arch/arm/mach-tegra/tegra20/warmboot_avp.c +0 -0
index 616358b657be..0ae401c569b6 100644
@@ -11,10 +11,10 @@
  #include <asm/arch/flow.h>
  #include <asm/arch/pinmux.h>
  #include <asm/arch/tegra.h>
Quoted 8 lines

arch/arm/mach-tegra/tegra20/warmboot_avp.c line 17

Quoted 5 lines
arch/arm/mach-tegra/tegra20/warmboot_avp.c +1 -1
-#include <asm/arch-tegra/apb_misc.h>
  #include <asm/arch-tegra/clk_rst.h>
  #include <asm/arch-tegra/pmc.h>
  #include <asm/arch-tegra/warmboot.h>
+#include "../apb_misc.h"

Is this really an improvement?

Yes:-P

Quoted 1 line

What's the rationale?

Quoted 8 lines

As mentioned in the commit description, the content of the header is only used by code in arch/arm/mach-tegra/. By moving the header file out of a directory that's part of the include path, we ensure that code (such as drivers and core code) can't access the header without explicitly doing something unusual, which should ring alarm bells. This will help avoid future additions of code that touches Tegra internals rather than accessing functionality through standard/generic (or even custom but explicitly "exported") APIs.

Well if that's what you want, OK.

The ../xxx.h looks odd to me - like a temporary hack. Also if we have a driver for SoC functionality then it will likely need access to this stuff. But I can't see a better way to do this, and it does achieve your goal...

Regards,
Simon

#77 lore raw

PATCH 17/60 ARM: tegra: move apb_misc.h

Quoted 48 lines · Simon Glass

Hi Stephen,

Quoted 36 lines · Stephen Warren
Quoted 20 lines · Simon Glass

Hi Stephen,

Quoted 16 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra/, so move it there to avoid polluting the global include path.

arch/arm/mach-tegra/tegra20/warmboot_avp.c +0 -0
index 616358b657be..0ae401c569b6 100644
@@ -11,10 +11,10 @@
   #include <asm/arch/flow.h>
   #include <asm/arch/pinmux.h>
   #include <asm/arch/tegra.h>
Quoted 8 lines

arch/arm/mach-tegra/tegra20/warmboot_avp.c line 17

Quoted 5 lines
arch/arm/mach-tegra/tegra20/warmboot_avp.c +1 -1
-#include <asm/arch-tegra/apb_misc.h>
   #include <asm/arch-tegra/clk_rst.h>
   #include <asm/arch-tegra/pmc.h>
   #include <asm/arch-tegra/warmboot.h>
+#include "../apb_misc.h"

Is this really an improvement?

Yes:-P

Quoted 1 line

What's the rationale?

Quoted 8 lines

As mentioned in the commit description, the content of the header is only used by code in arch/arm/mach-tegra/. By moving the header file out of a directory that's part of the include path, we ensure that code (such as drivers and core code) can't access the header without explicitly doing something unusual, which should ring alarm bells. This will help avoid future additions of code that touches Tegra internals rather than accessing functionality through standard/generic (or even custom but explicitly "exported") APIs.

Quoted 8 lines

Well if that's what you want, OK.

The ../xxx.h looks odd to me - like a temporary hack. Also if we have a driver for SoC functionality then it will likely need access to this stuff. But I can't see a better way to do this, and it does achieve your goal...

Thanks.

If we do end up with a "real" driver for this in drivers/xxx/, I would hope the register header would move into the same directory along with the C file so nothing else could access it, and other code would only access those registers by calling functions in the driver, those functions being prototyped in some public header file in include/ or arch/arm/mach-tegra/include/mach/ depending on whether the API was U-Boot-wide or Tegra-specific.

This current patch does mean if we get a driver, we'll have to move the header again, but I don't expect that to happen imminently (perhaps ever?) for most of the code in arch/arm/mach-tegra, with the possible exception of clock/reset/XUSB drivers. Equally, there would be so much change involved in converting everything not to access the register directly but instead use clean APIs that including a header move as well would likely be close to noise.

#78 lore raw

PATCH 18/60 ARM: tegra: move fuse.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

---
 arch/arm/mach-tegra/ap.c                               | 2 +-
 arch/arm/{include/asm/arch-tegra => mach-tegra}/fuse.h | 8 ++++----
 arch/arm/mach-tegra/tegra20/warmboot.c                 | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/fuse.h (83%)
arch/arm/mach-tegra/ap.c +1 -1
index 336a7e08196d..d226d546a1e5 100644
@@ -13,12 +13,12 @@
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/mc.h>
 #include <asm/arch-tegra/clock.h>
-#include <asm/arch-tegra/fuse.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/scu.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/arch-tegra/warmboot.h>
 #include "cpu.h"
+#include "fuse.h"
 
 int tegra_get_chip(void)
 {
arch/arm/mach-tegra/fuse.h renamed from arch/arm/include/asm/arch-tegra/fuse.h +4 -4
similarity index 83%
rename from arch/arm/include/asm/arch-tegra/fuse.h
rename to arch/arm/mach-tegra/fuse.h
index 39b578c00d2c..448cf0869cde 100644
@@ -1,12 +1,12 @@
 /*
- *  (C) Copyright 2010,2011
+ *  (C) Copyright 2010-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _FUSE_H_
-#define _FUSE_H_
+#ifndef _TEGRA_FUSE_H
+#define _TEGRA_FUSE_H
 
 /* FUSE registers */
 struct fuse_regs {
@@ -20,4 +20,4 @@ struct fuse_regs {
 	u32 security_mode;		/* 0x1A0: FUSE_SECURITY_MODE */
 };
 
-#endif	/* ifndef _FUSE_H_ */
+#endif
arch/arm/mach-tegra/tegra20/warmboot.c +1 -1
index 427af25032bc..ba996d1801da 100644
@@ -16,9 +16,9 @@
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
-#include <asm/arch-tegra/fuse.h>
 #include <asm/arch-tegra/warmboot.h>
 #include "../apb_misc.h"
+#include "../fuse.h"
 #include "crypto.h"
 
 DECLARE_GLOBAL_DATA_PTR;
Signature · 1 line
2.8.1
#79 lore raw

PATCH 18/60 ARM: tegra: move fuse.h

Quoted 5 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

Quoted 7 lines
---
 arch/arm/mach-tegra/ap.c                               | 2 +-
 arch/arm/{include/asm/arch-tegra => mach-tegra}/fuse.h | 8 ++++----
 arch/arm/mach-tegra/tegra20/warmboot.c                 | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/fuse.h (83%)
#80 lore raw

PATCH 19/60 ARM: tegra: move gpu.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

---
 arch/arm/mach-tegra/board2.c                          | 2 +-
 arch/arm/mach-tegra/gpu.c                             | 6 +++---
 arch/arm/{include/asm/arch-tegra => mach-tegra}/gpu.h | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/gpu.h (80%)
arch/arm/mach-tegra/board2.c +1 -1
index 3ee65ee3f921..35ae69fbbe29 100644
@@ -22,7 +22,6 @@
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/sys_proto.h>
 #include <asm/arch-tegra/warmboot.h>
-#include <asm/arch-tegra/gpu.h>
 #ifdef CONFIG_TEGRA_CLOCK_SCALING
 #include <asm/arch/emc.h>
 #endif
@@ -38,6 +37,7 @@
 #include <i2c.h>
 #include <spi.h>
 #include "emc.h"
+#include "gpu.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/mach-tegra/gpu.c +3 -3
index 74b64a620c5f..0da681bfe927 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2015, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -7,11 +7,11 @@
 /* Tegra vpr routines */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <asm/io.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch/mc.h>
-
-#include <fdt_support.h>
+#include "gpu.h"
 
 static bool _configured;
 
arch/arm/mach-tegra/gpu.h renamed from arch/arm/include/asm/arch-tegra/gpu.h +4 -4
similarity index 80%
rename from arch/arm/include/asm/arch-tegra/gpu.h
rename to arch/arm/mach-tegra/gpu.h
index 6be9f6157b36..12f0c6a2bf3e 100644
@@ -1,12 +1,12 @@
 /*
- *  (C) Copyright 2015
+ *  (C) Copyright 2015-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef __ASM_ARCH_TEGRA_GPU_H
-#define __ASM_ARCH_TEGRA_GPU_H
+#ifndef _TEGRA_GPU_H
+#define _TEGRA_GPU_H
 
 #if defined(CONFIG_TEGRA_GPU)
 
@@ -33,4 +33,4 @@ static inline int tegra_gpu_enable_node(void *blob, const char *compat)
 
 #endif /* CONFIG_OF_LIBFDT */
 
-#endif	/* __ASM_ARCH_TEGRA_GPU_H */
+#endif
Signature · 1 line
2.8.1
#81 lore raw

PATCH 19/60 ARM: tegra: move gpu.h

Quoted 5 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

Quoted 7 lines
---
 arch/arm/mach-tegra/board2.c                          | 2 +-
 arch/arm/mach-tegra/gpu.c                             | 6 +++---
 arch/arm/{include/asm/arch-tegra => mach-tegra}/gpu.h | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/gpu.h (80%)
#82 lore raw

PATCH 20/60 ARM: tegra: move pmc.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

---
 arch/arm/mach-tegra/ap.c                              | 2 +-
 arch/arm/mach-tegra/board.c                           | 2 +-
 arch/arm/mach-tegra/board2.c                          | 2 +-
 arch/arm/mach-tegra/clock.c                           | 2 +-
 arch/arm/mach-tegra/cmd_enterrcm.c                    | 4 ++--
 arch/arm/mach-tegra/cpu.c                             | 4 ++--
 arch/arm/{include/asm/arch-tegra => mach-tegra}/pmc.h | 6 +++---
 arch/arm/mach-tegra/tegra114/cpu.c                    | 4 ++--
 arch/arm/mach-tegra/tegra124/cpu.c                    | 2 +-
 arch/arm/mach-tegra/tegra124/psci.c                   | 2 +-
 arch/arm/mach-tegra/tegra20/cpu.c                     | 4 ++--
 arch/arm/mach-tegra/tegra20/warmboot.c                | 2 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.c            | 2 +-
 arch/arm/mach-tegra/tegra30/cpu.c                     | 2 +-
 board/nvidia/nyan-big/nyan-big.c                      | 1 -
 15 files changed, 20 insertions(+), 21 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/pmc.h (99%)
arch/arm/mach-tegra/ap.c +1 -1
index d226d546a1e5..94cc124979c6 100644
@@ -13,12 +13,12 @@
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/mc.h>
 #include <asm/arch-tegra/clock.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/scu.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/arch-tegra/warmboot.h>
 #include "cpu.h"
 #include "fuse.h"
+#include "pmc.h"
 
 int tegra_get_chip(void)
 {
arch/arm/mach-tegra/board.c +1 -1
index 098547ab1e88..2f80e2e0c696 100644
@@ -15,9 +15,9 @@
 #include <asm/arch/mc.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/board.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/sys_proto.h>
 #include <asm/arch-tegra/warmboot.h>
+#include "pmc.h"
 
 void save_boot_params_ret(void);
 
arch/arm/mach-tegra/board2.c +1 -1
index 35ae69fbbe29..c630fd18fdfe 100644
@@ -19,7 +19,6 @@
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/sys_proto.h>
 #include <asm/arch-tegra/warmboot.h>
 #ifdef CONFIG_TEGRA_CLOCK_SCALING
@@ -38,6 +37,7 @@
 #include <spi.h>
 #include "emc.h"
 #include "gpu.h"
+#include "pmc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/mach-tegra/clock.c +1 -1
index 80d6fccf2551..1a6fc0151a60 100644
@@ -12,9 +12,9 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <div64.h>
 #include <fdtdec.h>
+#include "pmc.h"
 
 /*
  * This is our record of the current clock rate of each clock. We don't
arch/arm/mach-tegra/cmd_enterrcm.c +2 -2
index a94ec93e7be1..d5205c39ab79 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2012-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * Derived from code (arch/arm/lib/reset.c) that is:
  *
@@ -27,7 +27,7 @@
 
 #include <common.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/pmc.h>
+#include "pmc.h"
 
 static int do_enterrcm(cmd_tbl_t *cmdtp, int flag, int argc,
 		       char * const argv[])
arch/arm/mach-tegra/cpu.c +2 -2
index a3ebb57f20b2..09d15974dd9b 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2015, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -11,9 +11,9 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/scu.h>
 #include "cpu.h"
+#include "pmc.h"
 
 int get_num_cpus(void)
 {
arch/arm/mach-tegra/pmc.h renamed from arch/arm/include/asm/arch-tegra/pmc.h +3 -3
similarity index 99%
rename from arch/arm/include/asm/arch-tegra/pmc.h
rename to arch/arm/mach-tegra/pmc.h
index 9c9b67448985..be38f007bc94 100644
@@ -5,8 +5,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _PMC_H_
-#define _PMC_H_
+#ifndef _TEGRA_PMC_H
+#define _TEGRA_PMC_H
 
 /* Power Management Controller (APBDEV_PMC_) registers */
 struct pmc_ctlr {
@@ -374,4 +374,4 @@ struct pmc_ctlr {
 /* APBDEV_PMC_CNTRL2_0 0x440 */
 #define HOLD_CKE_LOW_EN				(1 << 12)
 
-#endif	/* PMC_H */
+#endif
arch/arm/mach-tegra/tegra114/cpu.c +2 -2
index 272a2ea281ee..41e337fcfb57 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2014
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -12,8 +12,8 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include "../cpu.h"
+#include "../pmc.h"
 
 /* Tegra114-specific CPU init code */
 static void enable_cpu_power_rail(void)
arch/arm/mach-tegra/tegra124/cpu.c +1 -1
index be31cb4ac881..e8c8c507c404 100644
@@ -12,8 +12,8 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include "../cpu.h"
+#include "../pmc.h"
 
 /* Tegra124-specific CPU init code */
 
arch/arm/mach-tegra/tegra124/psci.c +1 -1
index 08225e32dbd4..739cf352676e 100644
@@ -11,8 +11,8 @@
 #include <asm/psci.h>
 #include <asm/arch/flow.h>
 #include <asm/arch/powergate.h>
-#include <asm/arch-tegra/pmc.h>
 #include "../cpu.h"
+#include "../pmc.h"
 
 static void park_cpu(void)
 {
arch/arm/mach-tegra/tegra20/cpu.c +2 -2
index 7fbc2e28655c..10205dca5e53 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -7,8 +7,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/pmc.h>
 #include "../cpu.h"
+#include "../pmc.h"
 
 static void enable_cpu_power_rail(void)
 {
arch/arm/mach-tegra/tegra20/warmboot.c +1 -1
index ba996d1801da..5a0390b72a4a 100644
@@ -15,10 +15,10 @@
 #include <asm/arch/sdram_param.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/warmboot.h>
 #include "../apb_misc.h"
 #include "../fuse.h"
+#include "../pmc.h"
 #include "crypto.h"
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/mach-tegra/tegra20/warmboot_avp.c +1 -1
index 0ae401c569b6..d7f03c29df86 100644
@@ -12,10 +12,10 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/warmboot.h>
 #include "../apb_misc.h"
 #include "../cpu.h"
+#include "../pmc.h"
 #include "warmboot_avp.h"
 
 #define DEBUG_RESET_CORESIGHT
arch/arm/mach-tegra/tegra30/cpu.c +1 -1
index 774207354064..392c8d3bb76e 100644
@@ -10,9 +10,9 @@
 #include <asm/arch/flow.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <mach/tegra_i2c.h>
 #include "../cpu.h"
+#include "../pmc.h"
 
 /* Tegra30-specific CPU init code */
 
board/nvidia/nyan-big/nyan-big.c +0 -1
index 64d98f59a4c7..efd3c18ba740 100644
@@ -16,7 +16,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/mc.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/pmc.h>
 #include <mach/tegra_gpio.h>
 #include "pinmux-config-nyan-big.h"
 
Signature · 1 line
2.8.1
#83 lore raw

PATCH 20/60 ARM: tegra: move pmc.h

Quoted 16 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

---
 arch/arm/mach-tegra/ap.c                              | 2 +-
 arch/arm/mach-tegra/board.c                           | 2 +-
 arch/arm/mach-tegra/board2.c                          | 2 +-
 arch/arm/mach-tegra/clock.c                           | 2 +-
 arch/arm/mach-tegra/cmd_enterrcm.c                    | 4 ++--
 arch/arm/mach-tegra/cpu.c                             | 4 ++--
 arch/arm/{include/asm/arch-tegra => mach-tegra}/pmc.h | 6 +++---
 arch/arm/mach-tegra/tegra114/cpu.c                    | 4 ++--
 arch/arm/mach-tegra/tegra124/cpu.c                    | 2 +-
Quoted 8 lines
 arch/arm/mach-tegra/tegra124/psci.c                   | 2 +-
 arch/arm/mach-tegra/tegra20/cpu.c                     | 4 ++--
 arch/arm/mach-tegra/tegra20/warmboot.c                | 2 +-
 arch/arm/mach-tegra/tegra20/warmboot_avp.c            | 2 +-
 arch/arm/mach-tegra/tegra30/cpu.c                     | 2 +-
 board/nvidia/nyan-big/nyan-big.c                      | 1 -
 15 files changed, 20 insertions(+), 21 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/pmc.h (99%)
#84 lore raw

PATCH 21/60 ARM: tegra: move scu.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

---
 arch/arm/mach-tegra/ap.c                              | 2 +-
 arch/arm/mach-tegra/cpu.c                             | 2 +-
 arch/arm/{include/asm/arch-tegra => mach-tegra}/scu.h | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/scu.h (91%)
arch/arm/mach-tegra/ap.c +1 -1
index 94cc124979c6..386ca72707e8 100644
@@ -13,12 +13,12 @@
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/mc.h>
 #include <asm/arch-tegra/clock.h>
-#include <asm/arch-tegra/scu.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/arch-tegra/warmboot.h>
 #include "cpu.h"
 #include "fuse.h"
 #include "pmc.h"
+#include "scu.h"
 
 int tegra_get_chip(void)
 {
arch/arm/mach-tegra/cpu.c +1 -1
index 09d15974dd9b..3562a2d2188a 100644
@@ -11,9 +11,9 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/scu.h>
 #include "cpu.h"
 #include "pmc.h"
+#include "scu.h"
 
 int get_num_cpus(void)
 {
arch/arm/mach-tegra/scu.h renamed from arch/arm/include/asm/arch-tegra/scu.h +4 -4
similarity index 91%
rename from arch/arm/include/asm/arch-tegra/scu.h
rename to arch/arm/mach-tegra/scu.h
index 987c16ff45f9..b13c2d9d2061 100644
@@ -1,12 +1,12 @@
 /*
- *  (C) Copyright 2010,2011
+ *  (C) Copyright 2010-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _SCU_H_
-#define _SCU_H_
+#ifndef _TEGRA_SCU_H
+#define _TEGRA_SCU_H
 
 /* ARM Snoop Control Unit (SCU) registers */
 struct scu_ctlr {
@@ -24,4 +24,4 @@ struct scu_ctlr {
 
 #define SCU_CTRL_ENABLE		(1 << 0)
 
-#endif	/* SCU_H */
+#endif
Signature · 1 line
2.8.1
#85 lore raw

PATCH 21/60 ARM: tegra: move scu.h

Quoted 5 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

Quoted 7 lines
---
 arch/arm/mach-tegra/ap.c                              | 2 +-
 arch/arm/mach-tegra/cpu.c                             | 2 +-
 arch/arm/{include/asm/arch-tegra => mach-tegra}/scu.h | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra}/scu.h (91%)
#86 lore raw

PATCH 22/60 ARM: tegra: move warmboot.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

---
 arch/arm/mach-tegra/ap.c                                           | 1 -
 arch/arm/mach-tegra/board.c                                        | 1 -
 arch/arm/mach-tegra/board2.c                                       | 4 +++-
 arch/arm/mach-tegra/tegra20/warmboot.c                             | 2 +-
 arch/arm/{include/asm/arch-tegra => mach-tegra/tegra20}/warmboot.h | 4 ++--
 arch/arm/mach-tegra/tegra20/warmboot_avp.c                         | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/tegra20}/warmboot.h (98%)
arch/arm/mach-tegra/ap.c +0 -1
index 386ca72707e8..4cb6367cd0a4 100644
@@ -14,7 +14,6 @@
 #include <asm/arch/mc.h>
 #include <asm/arch-tegra/clock.h>
 #include <asm/arch-tegra/tegra.h>
-#include <asm/arch-tegra/warmboot.h>
 #include "cpu.h"
 #include "fuse.h"
 #include "pmc.h"
arch/arm/mach-tegra/board.c +0 -1
index 2f80e2e0c696..cf65ece060dd 100644
@@ -16,7 +16,6 @@
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/sys_proto.h>
-#include <asm/arch-tegra/warmboot.h>
 #include "pmc.h"
 
 void save_boot_params_ret(void);
arch/arm/mach-tegra/board2.c +3 -1
index c630fd18fdfe..b1db5febd199 100644
@@ -20,7 +20,6 @@
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/sys_proto.h>
-#include <asm/arch-tegra/warmboot.h>
 #ifdef CONFIG_TEGRA_CLOCK_SCALING
 #include <asm/arch/emc.h>
 #endif
@@ -38,6 +37,9 @@
 #include "emc.h"
 #include "gpu.h"
 #include "pmc.h"
+#ifdef CONFIG_TEGRA_LP0
+#include "tegra20/warmboot.h"
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/mach-tegra/tegra20/warmboot.c +1 -1
index 5a0390b72a4a..956eb96f027f 100644
@@ -15,11 +15,11 @@
 #include <asm/arch/sdram_param.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/warmboot.h>
 #include "../apb_misc.h"
 #include "../fuse.h"
 #include "../pmc.h"
 #include "crypto.h"
+#include "warmboot.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/mach-tegra/tegra20/warmboot.h renamed from arch/arm/include/asm/arch-tegra/warmboot.h +2 -2
similarity index 98%
rename from arch/arm/include/asm/arch-tegra/warmboot.h
rename to arch/arm/mach-tegra/tegra20/warmboot.h
index b6326c8f7b11..5651d28ad487 100644
@@ -5,8 +5,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _WARM_BOOT_H_
-#define _WARM_BOOT_H_
+#ifndef _TEGRA20_WARMBOOT_H
+#define _TEGRA20_WARMBOOT_H
 
 #define STRAP_OPT_A_RAM_CODE_SHIFT	4
 #define STRAP_OPT_A_RAM_CODE_MASK	(0xf << STRAP_OPT_A_RAM_CODE_SHIFT)
arch/arm/mach-tegra/tegra20/warmboot_avp.c +1 -1
index d7f03c29df86..f204582b99b8 100644
@@ -12,10 +12,10 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/warmboot.h>
 #include "../apb_misc.h"
 #include "../cpu.h"
 #include "../pmc.h"
+#include "warmboot.h"
 #include "warmboot_avp.h"
 
 #define DEBUG_RESET_CORESIGHT
Signature · 1 line
2.8.1
#87 lore raw

PATCH 22/60 ARM: tegra: move warmboot.h

Quoted 6 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

Quoted 9 lines
---
 arch/arm/mach-tegra/ap.c                                           | 1 -
 arch/arm/mach-tegra/board.c                                        | 1 -
 arch/arm/mach-tegra/board2.c                                       | 4 +++-
 arch/arm/mach-tegra/tegra20/warmboot.c                             | 2 +-
 arch/arm/{include/asm/arch-tegra => mach-tegra/tegra20}/warmboot.h | 4 ++--
 arch/arm/mach-tegra/tegra20/warmboot_avp.c                         | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/tegra20}/warmboot.h (98%)
#88 lore raw

PATCH 23/60 ARM: tegra: move xusb-padctl.h to <mach/>

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Machine-specific headers should be in this location. Eventually, we'll move all headers from arch/arm/include to arch/arm/mach-tegra/include, or find a way to delete them.

---
 arch/arm/mach-tegra/board2.c                                     | 2 +-
 .../asm/arch-tegra => mach-tegra/include/mach}/xusb-padctl.h     | 4 ++--
 arch/arm/mach-tegra/xusb-padctl-common.h                         | 9 ++++-----
 arch/arm/mach-tegra/xusb-padctl-dummy.c                          | 4 ++--
 drivers/pci/pci_tegra.c                                          | 5 +++--
 5 files changed, 12 insertions(+), 12 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/xusb-padctl.h (92%)
arch/arm/mach-tegra/board2.c +1 -1
index b1db5febd199..9d970c483e0e 100644
@@ -30,7 +30,7 @@
 #ifdef CONFIG_TEGRA_MMC
 #include <mach/tegra_mmc.h>
 #endif
-#include <asm/arch-tegra/xusb-padctl.h>
+#include <mach/xusb-padctl.h>
 #include <power/as3722.h>
 #include <i2c.h>
 #include <spi.h>
arch/arm/mach-tegra/include/mach/xusb-padctl.h renamed from arch/arm/include/asm/arch-tegra/xusb-padctl.h +2 -2
similarity index 92%
rename from arch/arm/include/asm/arch-tegra/xusb-padctl.h
rename to arch/arm/mach-tegra/include/mach/xusb-padctl.h
index b4b4c8ba4d10..ab277123be51 100644
@@ -1,5 +1,5 @@
-#ifndef _TEGRA_XUSB_PADCTL_H_
-#define _TEGRA_XUSB_PADCTL_H_
+#ifndef _MACH_XUSB_PADCTL_H
+#define _MACH_XUSB_PADCTL_H
 
 struct tegra_xusb_phy;
 
arch/arm/mach-tegra/xusb-padctl-common.h +4 -5
index f44790a65004..b63b2faaa1c6 100644
@@ -1,17 +1,16 @@
 /*
- * Copyright (c) 2014-2015, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier: GPL-2.0
  */
 
-#ifndef _TEGRA_XUSB_PADCTL_COMMON_H_
-#define _TEGRA_XUSB_PADCTL_COMMON_H_
+#ifndef _TEGRA_XUSB_PADCTL_COMMON_H
+#define _TEGRA_XUSB_PADCTL_COMMON_H
 
 #include <common.h>
 #include <fdtdec.h>
-
 #include <asm/io.h>
-#include <asm/arch-tegra/xusb-padctl.h>
+#include <mach/xusb-padctl.h>
 
 struct tegra_xusb_padctl_lane {
 	const char *name;
arch/arm/mach-tegra/xusb-padctl-dummy.c +2 -2
index 65f8d2ea967a..779ee97d1482 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier: GPL-2.0
  */
@@ -7,7 +7,7 @@
 #include <common.h>
 #include <errno.h>
 
-#include <asm/arch-tegra/xusb-padctl.h>
+#include <mach/xusb-padctl.h>
 
 struct tegra_xusb_phy * __weak tegra_xusb_phy_get(unsigned int type)
 {
drivers/pci/pci_tegra.c +3 -2
index 5dadf6fa62a7..5e0f9c50aef3 100644
@@ -5,7 +5,7 @@
  * Based on NVIDIA PCIe driver
  * Copyright (c) 2008-2009, NVIDIA Corporation.
  *
- * Copyright (c) 2013-2014, NVIDIA Corporation.
+ * Copyright (c) 2013-2016, NVIDIA Corporation.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -24,7 +24,8 @@
 
 #include <asm/arch/clock.h>
 #include <asm/arch/powergate.h>
-#include <asm/arch-tegra/xusb-padctl.h>
+
+#include <mach/xusb-padctl.h>
 
 #include <linux/list.h>
 
Signature · 1 line
2.8.1
#89 lore raw

PATCH 23/60 ARM: tegra: move xusb-padctl.h to <mach/>

Quoted 7 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Machine-specific headers should be in this location. Eventually, we'll move all headers from arch/arm/include to arch/arm/mach-tegra/include, or find a way to delete them.

Quoted 8 lines
---
 arch/arm/mach-tegra/board2.c                                     | 2 +-
 .../asm/arch-tegra => mach-tegra/include/mach}/xusb-padctl.h     | 4 ++--
 arch/arm/mach-tegra/xusb-padctl-common.h                         | 9 ++++-----
 arch/arm/mach-tegra/xusb-padctl-dummy.c                          | 4 ++--
 drivers/pci/pci_tegra.c                                          | 5 +++--
 5 files changed, 12 insertions(+), 12 deletions(-)
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/xusb-padctl.h (92%)
#90 lore raw

PATCH 24/60 ARM: tegra: unify+move {board, sys_proto}.h to <mach/>

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Machine-specific headers should be in this location. Eventually, we'll move all headers from arch/arm/include to arch/arm/mach-tegra/include, or find a way to delete them.

Both board and sys_proto.h served the same purpose; a place to prototype functions implemented by the board and called by code in mach-tegra/. Merge them into a single file to reduce the number of headers.

board_init_uart_f() is private to code in mach-tegra/ so remove its prototype from the public <mach/> header. cpu.h isn't a great place for it, but other functions implemented in the same C file are prototyped there, so it'll do for now. When the C files are all refactored for Tegra186, this should be cleaned up.

---
 arch/arm/include/asm/arch-tegra/sys_proto.h        | 33 ----------------------
 arch/arm/mach-tegra/board.c                        |  3 +-
 arch/arm/mach-tegra/board2.c                       |  4 +--
 arch/arm/mach-tegra/cpu.h                          |  2 ++
 arch/arm/mach-tegra/emc.c                          |  1 -
 .../arch-tegra => mach-tegra/include/mach}/board.h | 33 +++++++++++++++++-----
 arch/arm/mach-tegra/spl.c                          |  2 +-
 arch/arm/mach-tegra/tegra20/pmu.c                  |  1 -
 board/avionic-design/common/tamonten.c             |  3 +-
 board/nvidia/seaboard/seaboard.c                   |  2 +-
 board/toradex/colibri_t20/colibri_t20.c            |  2 +-
 11 files changed, 35 insertions(+), 51 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra/sys_proto.h
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/board.h (63%)
arch/arm/include/asm/arch-tegra/sys_proto.h deleted +0 -33
deleted file mode 100644
index 8c2f94b578fe..000000000000
@@ -1,33 +0,0 @@
-/*
- * (C) Copyright 2010-2016
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef _SYS_PROTO_H_
-#define _SYS_PROTO_H_
-
-/**
- * tegra_board_id() - Get the board iD
- *
- * @return a board ID, or -ve on error
- */
-int tegra_board_id(void);
-
-/**
- * tegra_lcd_pmic_init() - Set up the PMIC for a board
- *
- * @board_id: Board ID which may be used to select LCD type
- * @return 0 if OK, -ve on error
- */
-int tegra_lcd_pmic_init(int board_id);
-
-/**
- * nvidia_board_init() - perform any board-specific init
- *
- * @return 0 if OK, -ve on error
- */
-int nvidia_board_init(void);
-
-#endif
arch/arm/mach-tegra/board.c +1 -2
index cf65ece060dd..87a9b5266804 100644
@@ -14,8 +14,7 @@
 #include <asm/arch/funcmux.h>
 #include <asm/arch/mc.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/board.h>
-#include <asm/arch-tegra/sys_proto.h>
+#include <mach/board.h>
 #include "pmc.h"
 
 void save_boot_params_ret(void);
arch/arm/mach-tegra/board2.c +2 -2
index 9d970c483e0e..ce865be250e0 100644
@@ -17,9 +17,7 @@
 #include <asm/arch/pinmux.h>
 #include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/sys_proto.h>
 #ifdef CONFIG_TEGRA_CLOCK_SCALING
 #include <asm/arch/emc.h>
 #endif
@@ -27,6 +25,7 @@
 #ifdef CONFIG_USB_EHCI_TEGRA
 #include <usb.h>
 #endif
+#include <mach/board.h>
 #ifdef CONFIG_TEGRA_MMC
 #include <mach/tegra_mmc.h>
 #endif
@@ -34,6 +33,7 @@
 #include <power/as3722.h>
 #include <i2c.h>
 #include <spi.h>
+#include "cpu.h"
 #include "emc.h"
 #include "gpu.h"
 #include "pmc.h"
arch/arm/mach-tegra/cpu.h +2 -0
index c0284ce03787..88ffb29d18e1 100644
@@ -84,3 +84,5 @@ void config_cache(void);
 #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
 bool tegra_cpu_is_non_secure(void);
 #endif
+/* Set up early UART output */
+void board_init_uart_f(void);
arch/arm/mach-tegra/emc.c +0 -1
index 70aec7fc1b3d..25150bcc3e80 100644
@@ -12,7 +12,6 @@
 #include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/sys_proto.h>
 #include "emc.h"
 #include "cpu.h"
 
arch/arm/mach-tegra/include/mach/board.h renamed from arch/arm/include/asm/arch-tegra/board.h +26 -7
similarity index 63%
rename from arch/arm/include/asm/arch-tegra/board.h
rename to arch/arm/mach-tegra/include/mach/board.h
index 783bb3c0fa12..f6688ef761e7 100644
@@ -1,19 +1,16 @@
 /*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016
+ * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _TEGRA_BOARD_H_
-#define _TEGRA_BOARD_H_
+#ifndef _MACH_BOARD_H
+#define _MACH_BOARD_H
 
 /* Set up pinmux to make UART usable */
 void gpio_early_init_uart(void);
 
-/* Set up early UART output */
-void board_init_uart_f(void);
-
 /* Set up any early GPIOs the board might need for proper operation */
 void gpio_early_init(void);  /* overrideable GPIO config        */
 
@@ -31,4 +28,26 @@ void pin_mux_nand(void);     /* overridable NAND pinmux setup    */
 void pin_mux_mmc(void);      /* overridable mmc pinmux setup     */
 void pin_mux_display(void);  /* overridable DISPLAY pinmux setup */
 
+/**
+ * tegra_lcd_pmic_init() - Set up the PMIC for a board
+ *
+ * @board_id: Board ID which may be used to select LCD type
+ * @return 0 if OK, -ve on error
+ */
+int tegra_lcd_pmic_init(int board_id);
+
+/**
+ * tegra_board_id() - Get the board iD
+ *
+ * @return a board ID, or -ve on error
+ */
+int tegra_board_id(void);
+
+/**
+ * nvidia_board_init() - perform any board-specific init
+ *
+ * @return 0 if OK, -ve on error
+ */
+int nvidia_board_init(void);
+
 #endif
arch/arm/mach-tegra/spl.c +1 -1
index ad13ad5ba5fb..e793700b243e 100644
@@ -13,8 +13,8 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/board.h>
 #include <asm/spl.h>
+#include <mach/board.h>
 #include "apb_misc.h"
 #include "cpu.h"
 
arch/arm/mach-tegra/tegra20/pmu.c +0 -1
index 8488d97d5cde..2ebcfaf2695e 100644
@@ -10,7 +10,6 @@
 #include <tps6586x.h>
 #include <asm/io.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/sys_proto.h>
 #include <mach/tegra_i2c.h>
 #include "../cpu.h"
 
board/avionic-design/common/tamonten.c +1 -2
index c05113c1c36c..c369d13e7f50 100644
@@ -16,9 +16,8 @@
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/clk_rst.h>
-#include <asm/arch-tegra/sys_proto.h>
+#include <mach/board.h>
 
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 void gpio_early_init(void)
board/nvidia/seaboard/seaboard.c +1 -1
index 9c92fc2e29e2..913679e888d3 100644
@@ -13,7 +13,7 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch-tegra/board.h>
+#include <mach/board.h>
 
 /* TODO: Remove this code when the SPI switch is working */
 #if (CONFIG_MACH_TYPE != MACH_TYPE_VENTANA)
board/toradex/colibri_t20/colibri_t20.c +1 -1
index e47565fa6389..2505104b78fe 100644
@@ -13,8 +13,8 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/tegra.h>
+#include <mach/board.h>
 
 #define PMU_I2C_ADDRESS		0x34
 #define MAX_I2C_RETRY		3
Signature · 1 line
2.8.1
#91 lore raw

PATCH 24/60 ARM: tegra: unify+move {board, sys_proto}.h to <mach/>

Quoted 17 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Machine-specific headers should be in this location. Eventually, we'll move all headers from arch/arm/include to arch/arm/mach-tegra/include, or find a way to delete them.

Both board and sys_proto.h served the same purpose; a place to prototype functions implemented by the board and called by code in mach-tegra/. Merge them into a single file to reduce the number of headers.

board_init_uart_f() is private to code in mach-tegra/ so remove its prototype from the public <mach/> header. cpu.h isn't a great place for it, but other functions implemented in the same C file are prototyped there, so it'll do for now. When the C files are all refactored for Tegra186, this should be cleaned up.

Quoted 15 lines
---
 arch/arm/include/asm/arch-tegra/sys_proto.h        | 33 ----------------------
 arch/arm/mach-tegra/board.c                        |  3 +-
 arch/arm/mach-tegra/board2.c                       |  4 +--
 arch/arm/mach-tegra/cpu.h                          |  2 ++
 arch/arm/mach-tegra/emc.c                          |  1 -
 .../arch-tegra => mach-tegra/include/mach}/board.h | 33 +++++++++++++++++-----
 arch/arm/mach-tegra/spl.c                          |  2 +-
 arch/arm/mach-tegra/tegra20/pmu.c                  |  1 -
 board/avionic-design/common/tamonten.c             |  3 +-
 board/nvidia/seaboard/seaboard.c                   |  2 +-
 board/toradex/colibri_t20/colibri_t20.c            |  2 +-
 11 files changed, 35 insertions(+), 51 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra/sys_proto.h
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/board.h (63%)
#92 lore raw

PATCH 25/60 ARM: tegra: use consistently named include guards

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

... and add one missing set of include guards.

---
 arch/arm/mach-tegra/cpu.h                  | 6 ++++++
 arch/arm/mach-tegra/emc.h                  | 6 +++---
 arch/arm/mach-tegra/tegra20/crypto.h       | 6 +++---
 arch/arm/mach-tegra/tegra20/warmboot_avp.h | 4 ++--
 4 files changed, 14 insertions(+), 8 deletions(-)
arch/arm/mach-tegra/cpu.h +6 -0
index 88ffb29d18e1..e6dcfe25dfe3 100644
@@ -4,6 +4,10 @@
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
+
+#ifndef _TEGRA_CPU_H
+#define _TEGRA_CPU_H
+
 #include <asm/types.h>
 
 /* Stabilization delays, in usec */
@@ -86,3 +90,5 @@ bool tegra_cpu_is_non_secure(void);
 #endif
 /* Set up early UART output */
 void board_init_uart_f(void);
+
+#endif
arch/arm/mach-tegra/emc.h +3 -3
index 4095235179f5..46e1260585a1 100644
@@ -1,12 +1,12 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * (C) Copyright 2010,2011 NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016 NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _NVIDIA_EMC_H_
-#define _NVIDIA_EMC_H_
+#ifndef _TEGRA_EMC_H
+#define _TEGRA_EMC_H
 
 int board_emc_init(void);
 
arch/arm/mach-tegra/tegra20/crypto.h +3 -3
index f59b92768a44..55f7bb44cdee 100644
@@ -1,12 +1,12 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * (C) Copyright 2010 - 2011 NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016 NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _CRYPTO_H_
-#define _CRYPTO_H_
+#ifndef _TEGRA20_CRYPTO_H
+#define _TEGRA20_CRYPTO_H
 
 /**
  * Sign a block of data
arch/arm/mach-tegra/tegra20/warmboot_avp.h +2 -2
index 85892b023fad..2e5f8d016faa 100644
@@ -5,8 +5,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _WARMBOOT_AVP_H_
-#define _WARMBOOT_AVP_H_
+#ifndef _TEGRA20_WARMBOOT_AVP_H_
+#define _TEGRA20_WARMBOOT_AVP_H_
 
 #define TEGRA_DEV_L			0
 #define TEGRA_DEV_H			1
Signature · 1 line
2.8.1
#93 lore raw

PATCH 25/60 ARM: tegra: use consistently named include guards

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

... and add one missing set of include guards.

---
 arch/arm/mach-tegra/cpu.h                  | 6 ++++++
 arch/arm/mach-tegra/emc.h                  | 6 +++---
 arch/arm/mach-tegra/tegra20/crypto.h       | 6 +++---
 arch/arm/mach-tegra/tegra20/warmboot_avp.h | 4 ++--
 4 files changed, 14 insertions(+), 8 deletions(-)
#94 lore raw

PATCH 26/60 ARM: tegra: delete unused headers

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

These headers aren't included by anything, so can be deleted.

---
 arch/arm/include/asm/arch-tegra210/ahb.h | 80 --------------------------------
 1 file changed, 80 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra210/ahb.h
arch/arm/include/asm/arch-tegra210/ahb.h deleted +0 -80
deleted file mode 100644
index 2e676a436e3d..000000000000
@@ -1,80 +0,0 @@
-/*
- * (C) Copyright 2013-2016
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _TEGRA210_AHB_H_
-#define _TEGRA210_AHB_H_
-
-struct ahb_ctlr {
-	u32 reserved0;			/* 00h */
-	u32 arbitration_disable;	/* _ARBITRATION_DISABLE_0,	04h */
-	u32 arbitration_priority_ctrl;	/* _ARBITRATION_PRIORITY_CTRL_0,08h */
-	u32 arbitration_usr_protect;	/* _ARBITRATION_USR_PROTECT_0,	0ch */
-	u32 gizmo_ahb_mem;		/* _GIZMO_AHB_MEM_0,		10h */
-	u32 gizmo_apb_dma;		/* _GIZMO_APB_DMA_0,		14h */
-	u32 reserved6[2];		/* 18h, 1ch */
-	u32 gizmo_usb;			/* _GIZMO_USB_0,		20h */
-	u32 gizmo_ahb_xbar_bridge;	/* _GIZMO_AHB_XBAR_BRIDGE_0,	24h */
-	u32 gizmo_cpu_ahb_bridge;	/* _GIZMO_CPU_AHB_BRIDGE_0,	28h */
-	u32 gizmo_cop_ahb_bridge;	/* _GIZMO_COP_AHB_BRIDGE_0,	2ch */
-	u32 gizmo_xbar_apb_ctlr;	/* _GIZMO_XBAR_APB_CTLR_0,	30h */
-	u32 gizmo_vcp_ahb_bridge;	/* _GIZMO_VCP_AHB_BRIDGE_0,	34h */
-	u32 reserved13[2];		/* 38h, 3ch */
-	u32 gizmo_nand;			/* _GIZMO_NAND_0,		40h */
-	u32 reserved15;			/* 44h */
-	u32 gizmo_sdmmc4;		/* _GIZMO_SDMMC4_0,		48h */
-	u32 reserved17;			/* 4ch */
-	u32 gizmo_se;			/* _GIZMO_SE_0,			50h */
-	u32 gizmo_tzram;		/* _GIZMO_TZRAM_0,		54h */
-	u32 reserved20[3];		/* 58h, 5ch, 60h */
-	u32 gizmo_bsev;			/* _GIZMO_BSEV_0,		64h */
-	u32 reserved22[3];		/* 68h, 6ch, 70h */
-	u32 gizmo_bsea;			/* _GIZMO_BSEA_0,		74h */
-	u32 gizmo_nor;			/* _GIZMO_NOR_0,		78h */
-	u32 gizmo_usb2;			/* _GIZMO_USB2_0,		7ch */
-	u32 gizmo_usb3;			/* _GIZMO_USB3_0,		80h */
-	u32 gizmo_sdmmc1;		/* _GIZMO_SDMMC1_0,		84h */
-	u32 gizmo_sdmmc2;		/* _GIZMO_SDMMC2_0,		88h */
-	u32 gizmo_sdmmc3;		/* _GIZMO_SDMMC3_0,		8ch */
-	u32 reserved30[13];		/* 90h ~ c0h */
-	u32 ahb_wrq_empty;		/* _AHB_WRQ_EMPTY_0,		c4h */
-	u32 reserved32[5];		/* c8h ~ d8h */
-	u32 ahb_mem_prefetch_cfg_x;	/* _AHB_MEM_PREFETCH_CFG_X_0,	dch */
-	u32 arbitration_xbar_ctrl;	/* _ARBITRATION_XBAR_CTRL_0,	e0h */
-	u32 ahb_mem_prefetch_cfg3;	/* _AHB_MEM_PREFETCH_CFG3_0,	e4h */
-	u32 ahb_mem_prefetch_cfg4;	/* _AHB_MEM_PREFETCH_CFG3_0,	e8h */
-	u32 avp_ppcs_rd_coh_status;	/* _AVP_PPCS_RD_COH_STATUS_0,	ech */
-	u32 ahb_mem_prefetch_cfg1;	/* _AHB_MEM_PREFETCH_CFG1_0,	f0h */
-	u32 ahb_mem_prefetch_cfg2;	/* _AHB_MEM_PREFETCH_CFG2_0,	f4h */
-	u32 ahbslvmem_status;		/* _AHBSLVMEM_STATUS_0, f8h */
-	/* _ARBITRATION_AHB_MEM_WRQUE_MST_ID_0, fch */
-	u32 arbitration_ahb_mem_wrque_mst_id;
-	u32 arbitration_cpu_abort_addr;	/* _ARBITRATION_CPU_ABORT_ADDR_0,100h */
-	u32 arbitration_cpu_abort_info;	/* _ARBITRATION_CPU_ABORT_INFO_0,104h */
-	u32 arbitration_cop_abort_addr;	/* _ARBITRATION_COP_ABORT_ADDR_0,108h */
-	u32 arbitration_cop_abort_info;	/* _ARBITRATION_COP_ABORT_INFO_0,10ch */
-	u32 reserved46[4];		/* 110h ~ 11ch */
-	u32 avpc_mccif_fifoctrl;	/* _AVPC_MCCIF_FIFOCTRL_0,	120h */
-	u32 timeout_wcoal_avpc;		/* _TIMEOUT_WCOAL_AVPC_0,	124h */
-	u32 mpcorelp_mccif_fifoctrl;	/* _MPCORELP_MCCIF_FIFOCTRL_0,	128h */
-	u32 mpcore_mccif_fifoctrl;	/* _MPCORE_MCCIF_FIFOCTRL_0,	12ch */
-	u32 axicif_fastsync_ctrl;	/* AXICIF_FASTSYNC_CTRL_0,	130h */
-	u32 axicif_fastsync_statistics;	/* _AXICIF_FASTSYNC_STATISTICS_0,134h */
-	/* _AXICIF_FASTSYNC0_CPUCLK_TO_MCCLK_0,	138h */
-	u32 axicif_fastsync0_cpuclk_to_mcclk;
-	/* _AXICIF_FASTSYNC1_CPUCLK_TO_MCCLK_0, 13ch */
-	u32 axicif_fastsync1_cpuclk_to_mcclk;
-	/* _AXICIF_FASTSYNC2_CPUCLK_TO_MCCLK_0, 140h */
-	u32 axicif_fastsync2_cpuclk_to_mcclk;
-	/* _AXICIF_FASTSYNC0_MCCLK_TO_CPUCLK_0, 144h */
-	u32 axicif_fastsync0_mcclk_to_cpuclk;
-	/* _AXICIF_FASTSYNC1_MCCLK_TO_CPUCLK_0, 148h */
-	u32 axicif_fastsync1_mcclk_to_cpuclk;
-	/* _AXICIF_FASTSYNC2_MCCLK_TO_CPUCLK_0, 14ch */
-	u32 axicif_fastsync2_mcclk_to_cpuclk;
-};
-
-#endif	/* _TEGRA210_AHB_H_ */
Signature · 1 line
2.8.1
#96 lore raw

PATCH 27/60 ARM: tegra: move emc.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

tegra_set_emc() is moved between two emc.h so that mach-tegra/emc.h defines fairly public interfaces to the EMC functionality, and emc_priv.h contains internal register details.

---
 arch/arm/mach-tegra/board2.c                            |  3 ---
 arch/arm/mach-tegra/emc.c                               |  1 -
 arch/arm/mach-tegra/emc.h                               | 14 ++++++++++++++
 arch/arm/mach-tegra/tegra20/emc.c                       |  3 ++-
 .../emc.h => mach-tegra/tegra20/emc_priv.h}             | 17 +++--------------
 arch/arm/mach-tegra/tegra20/warmboot.c                  |  3 ++-
 6 files changed, 21 insertions(+), 20 deletions(-)
 rename arch/arm/{include/asm/arch-tegra20/emc.h => mach-tegra/tegra20/emc_priv.h} (83%)
arch/arm/mach-tegra/board2.c +0 -3
index ce865be250e0..269afdf7a6e5 100644
@@ -18,9 +18,6 @@
 #include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
-#ifdef CONFIG_TEGRA_CLOCK_SCALING
-#include <asm/arch/emc.h>
-#endif
 #include "../../../drivers/usb/host/ehci-tegra-priv.h"
 #ifdef CONFIG_USB_EHCI_TEGRA
 #include <usb.h>
arch/arm/mach-tegra/emc.c +0 -1
index 25150bcc3e80..945bdedaf82d 100644
@@ -8,7 +8,6 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/emc.h>
 #include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
arch/arm/mach-tegra/emc.h +14 -0
index 46e1260585a1..19527b67031e 100644
@@ -8,6 +8,20 @@
 #ifndef _TEGRA_EMC_H
 #define _TEGRA_EMC_H
 
+/* Implemented in SoC-agnostic EMC code, called by core board code */
 int board_emc_init(void);
 
+/**
+ * Set up the EMC for the given rate. The timing parameters are retrieved
+ * from the device tree "nvidia,tegra20-emc" node and its
+ * "nvidia,tegra20-emc-table" sub-nodes.
+ *
+ * @param blob	Device tree blob
+ * @param rate	Clock speed of memory controller in Hz (=2x memory bus rate)
+ * @return 0 if ok, else -ve error code (look in emc.c to decode it)
+ *
+ * Implemented by SoC-specific code.
+ */
+int tegra_set_emc(const void *blob, unsigned rate);
+
 #endif
arch/arm/mach-tegra/tegra20/emc.c +2 -1
index ace5fb5aa758..c2569418ba9f 100644
@@ -9,9 +9,10 @@
 #include <fdtdec.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/emc.h>
 #include <asm/arch/tegra.h>
 #include "../apb_misc.h"
+#include "../emc.h"
+#include "emc_priv.h"
 
 /*
  * The EMC registers have shadow registers.  When the EMC clock is updated
arch/arm/mach-tegra/tegra20/emc_priv.h renamed from arch/arm/include/asm/arch-tegra20/emc.h +3 -14
similarity index 83%
rename from arch/arm/include/asm/arch-tegra20/emc.h
rename to arch/arm/mach-tegra/tegra20/emc_priv.h
index a85f4c3d823d..108e8aa62576 100644
@@ -1,12 +1,12 @@
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * (C) Copyright 2010,2011 NVIDIA Corporation <www.nvidia.com>
+ * (C) Copyright 2010-2016 NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _ARCH_EMC_H_
-#define _ARCH_EMC_H_
+#ifndef _TEGRA20_EMC_PRIV_H
+#define _TEGRA20_EMC_PRIV_H
 
 #include <asm/types.h>
 
@@ -76,17 +76,6 @@ struct emc_ctlr {
 };
 
 /**
- * Set up the EMC for the given rate. The timing parameters are retrieved
- * from the device tree "nvidia,tegra20-emc" node and its
- * "nvidia,tegra20-emc-table" sub-nodes.
- *
- * @param blob	Device tree blob
- * @param rate	Clock speed of memory controller in Hz (=2x memory bus rate)
- * @return 0 if ok, else -ve error code (look in emc.c to decode it)
- */
-int tegra_set_emc(const void *blob, unsigned rate);
-
-/**
  * Get a pointer to the EMC controller from the device tree.
  *
  * @param blob	Device tree blob
arch/arm/mach-tegra/tegra20/warmboot.c +2 -1
index 956eb96f027f..94298907c084 100644
@@ -9,16 +9,17 @@
 #include <asm/io.h>
 #include <asm/errno.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/emc.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/sdram_param.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include "../apb_misc.h"
+#include "../emc.h"
 #include "../fuse.h"
 #include "../pmc.h"
 #include "crypto.h"
+#include "emc_priv.h"
 #include "warmboot.h"
 
 DECLARE_GLOBAL_DATA_PTR;
Signature · 1 line
2.8.1
#97 lore raw

PATCH 27/60 ARM: tegra: move emc.h

Quoted 10 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

tegra_set_emc() is moved between two emc.h so that mach-tegra/emc.h defines fairly public interfaces to the EMC functionality, and emc_priv.h contains internal register details.

Quoted 9 lines
---
 arch/arm/mach-tegra/board2.c                            |  3 ---
 arch/arm/mach-tegra/emc.c                               |  1 -
 arch/arm/mach-tegra/emc.h                               | 14 ++++++++++++++
 arch/arm/mach-tegra/tegra20/emc.c                       |  3 ++-
 .../emc.h => mach-tegra/tegra20/emc_priv.h}             | 17 +++--------------
 arch/arm/mach-tegra/tegra20/warmboot.c                  |  3 ++-
 6 files changed, 21 insertions(+), 20 deletions(-)
 rename arch/arm/{include/asm/arch-tegra20/emc.h => mach-tegra/tegra20/emc_priv.h} (83%)
#98 lore raw

PATCH 28/60 ARM: tegra: move sdram_param.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

---
 .../{include/asm/arch-tegra20 => mach-tegra/tegra20}/sdram_param.h  | 6 +++---
 arch/arm/mach-tegra/tegra20/warmboot.c                              | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20}/sdram_param.h (96%)
arch/arm/mach-tegra/tegra20/sdram_param.h renamed from arch/arm/include/asm/arch-tegra20/sdram_param.h +3 -3
similarity index 96%
rename from arch/arm/include/asm/arch-tegra20/sdram_param.h
rename to arch/arm/mach-tegra/tegra20/sdram_param.h
index aaf05084e96f..19cb5ab2f47a 100644
@@ -1,12 +1,12 @@
 /*
- *  (C) Copyright 2010, 2011
+ *  (C) Copyright 2010-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _SDRAM_PARAM_H_
-#define _SDRAM_PARAM_H_
+#ifndef _TEGRA20_SDRAM_PARAM_H
+#define _TEGRA20_SDRAM_PARAM_H
 
 /*
  * Defines the number of 32-bit words provided in each set of SDRAM parameters
arch/arm/mach-tegra/tegra20/warmboot.c +1 -1
index 94298907c084..9d67bdef494a 100644
@@ -11,7 +11,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/sdram_param.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include "../apb_misc.h"
@@ -20,6 +19,7 @@
 #include "../pmc.h"
 #include "crypto.h"
 #include "emc_priv.h"
+#include "sdram_param.h"
 #include "warmboot.h"
 
 DECLARE_GLOBAL_DATA_PTR;
Signature · 1 line
2.8.1
#99 lore raw

PATCH 28/60 ARM: tegra: move sdram_param.h

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path.

---
 .../{include/asm/arch-tegra20 => mach-tegra/tegra20}/sdram_param.h  | 6 +++---
 arch/arm/mach-tegra/tegra20/warmboot.c                              | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20}/sdram_param.h (96%)
#100 lore raw

PATCH 29/60 ARM: tegra: move sysctr.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path. Also, unify the 3 identical copies of the file into one.

---
 arch/arm/include/asm/arch-tegra124/sysctr.h        | 26 ----------------------
 arch/arm/include/asm/arch-tegra210/sysctr.h        | 26 ----------------------
 .../asm/arch-tegra114 => mach-tegra}/sysctr.h      |  8 +++----
 arch/arm/mach-tegra/tegra114/clock.c               |  2 +-
 arch/arm/mach-tegra/tegra124/clock.c               |  2 +-
 arch/arm/mach-tegra/tegra210/clock.c               |  2 +-
 6 files changed, 7 insertions(+), 59 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra124/sysctr.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/sysctr.h
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra}/sysctr.h (81%)
arch/arm/include/asm/arch-tegra124/sysctr.h deleted +0 -26
deleted file mode 100644
index 3f0309b78fae..000000000000
@@ -1,26 +0,0 @@
-/*
- * (C) Copyright 2013
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _TEGRA124_SYSCTR_H_
-#define _TEGRA124_SYSCTR_H_
-
-struct sysctr_ctlr {
-	u32 cntcr;		/* 0x00: SYSCTR0_CNTCR Counter Control */
-	u32 cntsr;		/* 0x04: SYSCTR0_CNTSR Counter Status */
-	u32 cntcv0;		/* 0x08: SYSCTR0_CNTCV0 Counter Count 31:00 */
-	u32 cntcv1;		/* 0x0C: SYSCTR0_CNTCV1 Counter Count 63:32 */
-	u32 reserved1[4];	/* 0x10 - 0x1C */
-	u32 cntfid0;		/* 0x20: SYSCTR0_CNTFID0 Freq Table Entry */
-	u32 cntfid1;		/* 0x24: SYSCTR0_CNTFID1 Freq Table End */
-	u32 reserved2[1002];	/* 0x28 - 0xFCC */
-	u32 counterid[12];	/* 0xFD0 - 0xFxx CounterID regs, RO */
-};
-
-#define TSC_CNTCR_ENABLE	(1 << 0)	/* Enable */
-#define TSC_CNTCR_HDBG		(1 << 1)	/* Halt on debug */
-
-#endif	/* _TEGRA124_SYSCTR_H_ */
arch/arm/include/asm/arch-tegra210/sysctr.h deleted +0 -26
deleted file mode 100644
index e8a13b502a6d..000000000000
@@ -1,26 +0,0 @@
-/*
- * (C) Copyright 2013-2015
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _TEGRA210_SYSCTR_H_
-#define _TEGRA210_SYSCTR_H_
-
-struct sysctr_ctlr {
-	u32 cntcr;		/* 0x00: SYSCTR0_CNTCR Counter Control */
-	u32 cntsr;		/* 0x04: SYSCTR0_CNTSR Counter Status */
-	u32 cntcv0;		/* 0x08: SYSCTR0_CNTCV0 Counter Count 31:00 */
-	u32 cntcv1;		/* 0x0C: SYSCTR0_CNTCV1 Counter Count 63:32 */
-	u32 reserved1[4];	/* 0x10 - 0x1C */
-	u32 cntfid0;		/* 0x20: SYSCTR0_CNTFID0 Freq Table Entry */
-	u32 cntfid1;		/* 0x24: SYSCTR0_CNTFID1 Freq Table End */
-	u32 reserved2[1002];	/* 0x28 - 0xFCC */
-	u32 counterid[12];	/* 0xFD0 - 0xFxx CounterID regs, RO */
-};
-
-#define TSC_CNTCR_ENABLE	(1 << 0)	/* Enable */
-#define TSC_CNTCR_HDBG		(1 << 1)	/* Halt on debug */
-
-#endif	/* _TEGRA210_SYSCTR_H_ */
arch/arm/mach-tegra/sysctr.h renamed from arch/arm/include/asm/arch-tegra114/sysctr.h +4 -4
similarity index 81%
rename from arch/arm/include/asm/arch-tegra114/sysctr.h
rename to arch/arm/mach-tegra/sysctr.h
index 38220aac8eed..27930d1c3240 100644
@@ -1,11 +1,11 @@
 /*
- * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2013-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
 
-#ifndef _TEGRA114_SYSCTR_H_
-#define _TEGRA114_SYSCTR_H_
+#ifndef _TEGRA_SYSCTR_H
+#define _TEGRA_SYSCTR_H
 
 struct sysctr_ctlr {
 	u32 cntcr;		/* 0x00: SYSCTR0_CNTCR Counter Control */
@@ -22,4 +22,4 @@ struct sysctr_ctlr {
 #define TSC_CNTCR_ENABLE	(1 << 0)	/* Enable */
 #define TSC_CNTCR_HDBG		(1 << 1)	/* Halt on debug */
 
-#endif	/* _TEGRA114_SYSCTR_H_ */
+#endif
arch/arm/mach-tegra/tegra114/clock.c +1 -1
index 7a73e159a7cd..155353d44c52 100644
@@ -10,11 +10,11 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/sysctr.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <div64.h>
 #include <fdtdec.h>
+#include "../sysctr.h"
 
 /*
  * Clock types that we can use as a source. The Tegra114 has muxes for the
arch/arm/mach-tegra/tegra124/clock.c +1 -1
index 1219b6413844..dc060a6db569 100644
@@ -10,11 +10,11 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/sysctr.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <div64.h>
 #include <fdtdec.h>
+#include "../sysctr.h"
 
 /*
  * Clock types that we can use as a source. The Tegra124 has muxes for the
arch/arm/mach-tegra/tegra210/clock.c +1 -1
index b025711acf09..d2d517b2c711 100644
@@ -11,11 +11,11 @@
 #include <errno.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/sysctr.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <div64.h>
 #include <fdtdec.h>
+#include "../sysctr.h"
 
 /*
  * Clock types that we can use as a source. The Tegra210 has muxes for the
Signature · 1 line
2.8.1
#101 lore raw

PATCH 29/60 ARM: tegra: move sysctr.h

Quoted 7 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there to avoid polluting the global include path. Also, unify the 3 identical copies of the file into one.

Quoted 11 lines
---
 arch/arm/include/asm/arch-tegra124/sysctr.h        | 26 ----------------------
 arch/arm/include/asm/arch-tegra210/sysctr.h        | 26 ----------------------
 .../asm/arch-tegra114 => mach-tegra}/sysctr.h      |  8 +++----
 arch/arm/mach-tegra/tegra114/clock.c               |  2 +-
 arch/arm/mach-tegra/tegra124/clock.c               |  2 +-
 arch/arm/mach-tegra/tegra210/clock.c               |  2 +-
 6 files changed, 7 insertions(+), 59 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra124/sysctr.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/sysctr.h
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra}/sysctr.h (81%)
#102 lore raw

PATCH 30/60 ARM: tegra: remove pmu.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is duplicated many times, and does nothing but prototype a single function that's used solely by mach-tegra code. Move the proto- type of mach-tegra/cpu.h. That's not an awesome location for it, but other similar functions like pmic_enable_cpu_vdd() are already there.

---
 arch/arm/include/asm/arch-tegra114/pmu.h | 13 -------------
 arch/arm/include/asm/arch-tegra124/pmu.h | 14 --------------
 arch/arm/include/asm/arch-tegra20/pmu.h  | 14 --------------
 arch/arm/include/asm/arch-tegra210/pmu.h | 14 --------------
 arch/arm/include/asm/arch-tegra30/pmu.h  | 13 -------------
 arch/arm/mach-tegra/board2.c             |  1 -
 arch/arm/mach-tegra/cpu.h                |  2 ++
 arch/arm/mach-tegra/emc.c                |  1 -
 8 files changed, 2 insertions(+), 70 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra114/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/pmu.h
arch/arm/include/asm/arch-tegra114/pmu.h deleted +0 -13
deleted file mode 100644
index 3104a1b855b8..000000000000
@@ -1,13 +0,0 @@
-/*
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
- *
- * SPDX-License-Identifier:	GPL-2.0
- */
-
-#ifndef _TEGRA114_PMU_H_
-#define _TEGRA114_PMU_H_
-
-/* Set core and CPU voltages to nominal levels */
-int pmu_set_nominal(void);
-
-#endif	/* _TEGRA114_PMU_H_ */
arch/arm/include/asm/arch-tegra124/pmu.h deleted +0 -14
deleted file mode 100644
index b10100a63671..000000000000
@@ -1,14 +0,0 @@
-/*
- * (C) Copyright 2010-2013
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _TEGRA124_PMU_H_
-#define _TEGRA124_PMU_H_
-
-/* Set core and CPU voltages to nominal levels */
-int pmu_set_nominal(void);
-
-#endif	/* _TEGRA124_PMU_H_ */
arch/arm/include/asm/arch-tegra20/pmu.h deleted +0 -14
deleted file mode 100644
index 46effb47e18d..000000000000
@@ -1,14 +0,0 @@
-/*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-
-#ifndef _ARCH_PMU_H_
-#define _ARCH_PMU_H_
-
-/* Set core and CPU voltages to nominal levels */
-int pmu_set_nominal(void);
-
-#endif	/* _ARCH_PMU_H_ */
arch/arm/include/asm/arch-tegra210/pmu.h deleted +0 -14
deleted file mode 100644
index 1e5f3886c675..000000000000
@@ -1,14 +0,0 @@
-/*
- * (C) Copyright 2010-2015
- * NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#ifndef _TEGRA210_PMU_H_
-#define _TEGRA210_PMU_H_
-
-/* Set core and CPU voltages to nominal levels */
-int pmu_set_nominal(void);
-
-#endif	/* _TEGRA210_PMU_H_ */
arch/arm/include/asm/arch-tegra30/pmu.h deleted +0 -13
deleted file mode 100644
index f01c37ed673b..000000000000
@@ -1,13 +0,0 @@
-/*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
- *
- * SPDX-License-Identifier:	GPL-2.0
- */
-
-#ifndef _TEGRA30_PMU_H_
-#define _TEGRA30_PMU_H_
-
-/* Set core and CPU voltages to nominal levels */
-int pmu_set_nominal(void);
-
-#endif	/* _TEGRA30_PMU_H_ */
arch/arm/mach-tegra/board2.c +0 -1
index 269afdf7a6e5..684d4a5ad853 100644
@@ -15,7 +15,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include "../../../drivers/usb/host/ehci-tegra-priv.h"
arch/arm/mach-tegra/cpu.h +2 -0
index e6dcfe25dfe3..f1f5b179c198 100644
@@ -82,6 +82,8 @@ int tegra_get_sku_info(void);
  */
 int tegra_get_chip_sku(void);
 void adjust_pllp_out_freqs(void);
+/* Set core and CPU voltages to nominal levels */
+int pmu_set_nominal(void);
 void pmic_enable_cpu_vdd(void);
 /* Do any chip-specific cache config */
 void config_cache(void);
arch/arm/mach-tegra/emc.c +0 -1
index 945bdedaf82d..86aba51e398e 100644
@@ -8,7 +8,6 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include "emc.h"
Signature · 1 line
2.8.1
#103 lore raw

PATCH 30/60 ARM: tegra: remove pmu.h

Hi Stephen,

Quoted 8 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is duplicated many times, and does nothing but prototype a single function that's used solely by mach-tegra code. Move the proto- type of mach-tegra/cpu.h. That's not an awesome location for it, but other similar functions like pmic_enable_cpu_vdd() are already there.

Quoted 15 lines
---
 arch/arm/include/asm/arch-tegra114/pmu.h | 13 -------------
 arch/arm/include/asm/arch-tegra124/pmu.h | 14 --------------
 arch/arm/include/asm/arch-tegra20/pmu.h  | 14 --------------
 arch/arm/include/asm/arch-tegra210/pmu.h | 14 --------------
 arch/arm/include/asm/arch-tegra30/pmu.h  | 13 -------------
 arch/arm/mach-tegra/board2.c             |  1 -
 arch/arm/mach-tegra/cpu.h                |  2 ++
 arch/arm/mach-tegra/emc.c                |  1 -
 8 files changed, 2 insertions(+), 70 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra114/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/pmu.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/pmu.h

I wonder if it would be better to retain the header name and move pmic_enable_cpu_vdd()?

- Simon

#104 lore raw

PATCH 30/60 ARM: tegra: remove pmu.h

Quoted 10 lines · Simon Glass

Hi Stephen,

Quoted 6 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is duplicated many times, and does nothing but prototype a single function that's used solely by mach-tegra code. Move the proto- type of mach-tegra/cpu.h. That's not an awesome location for it, but other similar functions like pmic_enable_cpu_vdd() are already there.

Quoted 4 lines

I wonder if it would be better to retain the header name and move pmic_enable_cpu_vdd()?

I think that pmu_set_nominal() (the function moved into cpu.h by this patch) and pmic_enable_cpu_vdd() serve essentially the same semantic purpose, but are used on different sets of SoCs via ifdefs or weak functions. I expect that early in the part 2 series, I'll get rid of more code in board2.c's board_init() and put it into something like tegra_board_init_soc(), prototyped in board_init.h or soc_init.h.

Or put another way, I expect I'll clean up the "not a great location" issue mentioned in this patch description pretty soon.

#105 lore raw

PATCH 31/60 ARM: tegra: move powergate.h to <mach/>

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Machine-specific headers should be in this location. Eventually, we'll move all headers from arch/arm/include to arch/arm/mach-tegra/include, or find a way to delete them. This change also removes multiple useless empty wrappers for this header.

---
 arch/arm/include/asm/arch-tegra114/powergate.h               |  6 ------
 arch/arm/include/asm/arch-tegra124/powergate.h               |  6 ------
 arch/arm/include/asm/arch-tegra20/powergate.h                |  6 ------
 arch/arm/include/asm/arch-tegra210/powergate.h               | 12 ------------
 arch/arm/include/asm/arch-tegra30/powergate.h                |  6 ------
 .../asm/arch-tegra => mach-tegra/include/mach}/powergate.h   | 10 ++++++++--
 arch/arm/mach-tegra/powergate.c                              |  4 ++--
 arch/arm/mach-tegra/tegra124/psci.c                          |  2 +-
 drivers/pci/pci_tegra.c                                      |  2 +-
 9 files changed, 12 insertions(+), 42 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra114/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/powergate.h
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/powergate.h (83%)
arch/arm/include/asm/arch-tegra114/powergate.h deleted +0 -6
deleted file mode 100644
index 260ea801b81b..000000000000
@@ -1,6 +0,0 @@
-#ifndef _TEGRA114_POWERGATE_H_
-#define _TEGRA114_POWERGATE_H_
-
-#include <asm/arch-tegra/powergate.h>
-
-#endif /* _TEGRA114_POWERGATE_H_ */
arch/arm/include/asm/arch-tegra124/powergate.h deleted +0 -6
deleted file mode 100644
index 8a0cfbaf9665..000000000000
@@ -1,6 +0,0 @@
-#ifndef _TEGRA124_POWERGATE_H_
-#define _TEGRA124_POWERGATE_H_
-
-#include <asm/arch-tegra/powergate.h>
-
-#endif /* _TEGRA124_POWERGATE_H_ */
arch/arm/include/asm/arch-tegra20/powergate.h deleted +0 -6
deleted file mode 100644
index 439d88b7022a..000000000000
@@ -1,6 +0,0 @@
-#ifndef _TEGRA20_POWERGATE_H_
-#define _TEGRA20_POWERGATE_H_
-
-#include <asm/arch-tegra/powergate.h>
-
-#endif /* _TEGRA20_POWERGATE_H_ */
arch/arm/include/asm/arch-tegra210/powergate.h deleted +0 -12
deleted file mode 100644
index df6f91dece64..000000000000
@@ -1,12 +0,0 @@
-/*
- * Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#ifndef _TEGRA210_POWERGATE_H_
-#define _TEGRA210_POWERGATE_H_
-
-#include <asm/arch-tegra/powergate.h>
-
-#endif /* _TEGRA210_POWERGATE_H_ */
arch/arm/include/asm/arch-tegra30/powergate.h deleted +0 -6
deleted file mode 100644
index c70e44b6216d..000000000000
@@ -1,6 +0,0 @@
-#ifndef _TEGRA30_POWERGATE_H_
-#define _TEGRA30_POWERGATE_H_
-
-#include <asm/arch-tegra/powergate.h>
-
-#endif /* _TEGRA30_POWERGATE_H_ */
arch/arm/mach-tegra/include/mach/powergate.h renamed from arch/arm/include/asm/arch-tegra/powergate.h +8 -2
similarity index 83%
rename from arch/arm/include/asm/arch-tegra/powergate.h
rename to arch/arm/mach-tegra/include/mach/powergate.h
index 2e491f19005a..3ac9c9b092b1 100644
@@ -1,5 +1,11 @@
-#ifndef _TEGRA_POWERGATE_H_
-#define _TEGRA_POWERGATE_H_
+/*
+ * Copyright (c) 2016, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef _MACH_POWERGATE_H
+#define _MACH_POWERGATE_H
 
 #include <asm/arch/clock.h>
 
arch/arm/mach-tegra/powergate.c +2 -2
index 30ae036bff05..49723e88cc56 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier: GPL-2.0
  */
@@ -10,8 +10,8 @@
 #include <asm/io.h>
 #include <asm/types.h>
 #include <asm/arch/flow.h>
-#include <asm/arch/powergate.h>
 #include <asm/arch/tegra.h>
+#include <mach/powergate.h>
 
 #define PWRGATE_TOGGLE 0x30
 #define  PWRGATE_TOGGLE_START (1 << 8)
arch/arm/mach-tegra/tegra124/psci.c +1 -1
index 739cf352676e..b6d99c7740c7 100644
@@ -10,7 +10,7 @@
 #include <asm/io.h>
 #include <asm/psci.h>
 #include <asm/arch/flow.h>
-#include <asm/arch/powergate.h>
+#include <mach/powergate.h>
 #include "../cpu.h"
 #include "../pmc.h"
 
drivers/pci/pci_tegra.c +1 -1
index 5e0f9c50aef3..392ebde1e05c 100644
@@ -23,8 +23,8 @@
 #include <asm/gpio.h>
 
 #include <asm/arch/clock.h>
-#include <asm/arch/powergate.h>
 
+#include <mach/powergate.h>
 #include <mach/xusb-padctl.h>
 
 #include <linux/list.h>
Signature · 1 line
2.8.1
#106 lore raw

PATCH 31/60 ARM: tegra: move powergate.h to <mach/>

Quoted 17 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Machine-specific headers should be in this location. Eventually, we'll move all headers from arch/arm/include to arch/arm/mach-tegra/include, or find a way to delete them. This change also removes multiple useless empty wrappers for this header.

---
 arch/arm/include/asm/arch-tegra114/powergate.h               |  6 ------
 arch/arm/include/asm/arch-tegra124/powergate.h               |  6 ------
 arch/arm/include/asm/arch-tegra20/powergate.h                |  6 ------
 arch/arm/include/asm/arch-tegra210/powergate.h               | 12 ------------
 arch/arm/include/asm/arch-tegra30/powergate.h                |  6 ------
 .../asm/arch-tegra => mach-tegra/include/mach}/powergate.h   | 10 ++++++++--
 arch/arm/mach-tegra/powergate.c                              |  4 ++--
 arch/arm/mach-tegra/tegra124/psci.c                          |  2 +-
Quoted 8 lines
 drivers/pci/pci_tegra.c                                      |  2 +-
 9 files changed, 12 insertions(+), 42 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra114/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra124/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra20/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra210/powergate.h
 delete mode 100644 arch/arm/include/asm/arch-tegra30/powergate.h
 rename arch/arm/{include/asm/arch-tegra => mach-tegra/include/mach}/powergate.h (83%)
#107 lore raw

PATCH 32/60 ARM: tegra: add SoC-specific include directory

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Add arch/arm/mach-tegra/tegraNNN/include. We'll use this to house headers that must vary between SoCs (e.g. clock lists, register layouts that aren't static across chip versions, etc.) in a <soc/> name-space. This will allow code in mach-tegra/ to access those register definitions without polluting the more public <asm/> or <mach/> namespaces or the directories they map to.

---
 arch/arm/mach-tegra/config.mk | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 arch/arm/mach-tegra/config.mk
arch/arm/mach-tegra/config.mk new file +13 -0
new file mode 100644
index 000000000000..cc16451987e9
@@ -0,0 +1,13 @@
+# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
+#
+# SPDX-License-Identifier: GPL-2.0
+
+socdirs-$(CONFIG_TEGRA20)	+= tegra20
+socdirs-$(CONFIG_TEGRA30)	+= tegra30
+socdirs-$(CONFIG_TEGRA114)	+= tegra114
+socdirs-$(CONFIG_TEGRA124)	+= tegra124
+socdirs-$(CONFIG_TEGRA210)	+= tegra210
+
+#$(warning PLATFORM_CPPFLAGS pre  $(PLATFORM_CPPFLAGS))
+PLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/arch/arm/mach-tegra/%/include,$(socdirs-y))
+#$(warning PLATFORM_CPPFLAGS post $(PLATFORM_CPPFLAGS))
Signature · 1 line
2.8.1
#108 lore raw

PATCH 32/60 ARM: tegra: add SoC-specific include directory

Quoted 9 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Add arch/arm/mach-tegra/tegraNNN/include. We'll use this to house headers that must vary between SoCs (e.g. clock lists, register layouts that aren't static across chip versions, etc.) in a <soc/> name-space. This will allow code in mach-tegra/ to access those register definitions without polluting the more public <asm/> or <mach/> namespaces or the directories they map to.

Quoted 5 lines
---
 arch/arm/mach-tegra/config.mk | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 arch/arm/mach-tegra/config.mk
#109 lore raw

PATCH 33/60 ARM: tegra: fix bug in Tegra20 flow.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

According to the TRM, Tegra20's flow controller has a xrq_events field too. Suspend/resume (via LP0) does still work after this fix, implying the write to halt_cpu1_events in warmboot_avp.c isn't actually necessary, since this patch causes it to access a different register.

---
 arch/arm/include/asm/arch-tegra20/flow.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/include/asm/arch-tegra20/flow.h +2 -1
index 8a6a78311452..e7df5bbb906c 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010, 2011
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
@@ -13,6 +13,7 @@ struct flow_ctlr {
 	u32	halt_cop_events;
 	u32	cpu_csr;
 	u32	cop_csr;
+	u32	xrq_events;
 	u32	halt_cpu1_events;
 	u32	cpu1_csr;
 };
Signature · 1 line
2.8.1
#110 lore raw

PATCH 33/60 ARM: tegra: fix bug in Tegra20 flow.h

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

According to the TRM, Tegra20's flow controller has a xrq_events field too. Suspend/resume (via LP0) does still work after this fix, implying the write to halt_cpu1_events in warmboot_avp.c isn't actually necessary, since this patch causes it to access a different register.

---
 arch/arm/include/asm/arch-tegra20/flow.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
#111 lore raw

PATCH 34/60 ARM: tegra: move flow.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there. Since the definitions are used by code in mach-tegra/ itself, not just in SoC-specific mach-tegra/tegraNNN/, and the content varies per SoC, we need to put it in the (somewhat isolated) <soc/> include directory rather than in mach-tegra/ directly.

---
 arch/arm/mach-tegra/powergate.c                                   | 2 +-
 arch/arm/mach-tegra/tegra114/cpu.c                                | 2 +-
 .../asm/arch-tegra30 => mach-tegra/tegra114/include/soc}/flow.h   | 8 ++++----
 arch/arm/mach-tegra/tegra124/cpu.c                                | 2 +-
 .../asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/flow.h  | 6 +++---
 arch/arm/mach-tegra/tegra124/psci.c                               | 2 +-
 .../asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/flow.h    | 4 ++--
 arch/arm/mach-tegra/tegra20/warmboot_avp.c                        | 2 +-
 .../asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/flow.h  | 6 +++---
 arch/arm/mach-tegra/tegra30/cpu.c                                 | 2 +-
 .../asm/arch-tegra114 => mach-tegra/tegra30/include/soc}/flow.h   | 8 ++++----
 11 files changed, 22 insertions(+), 22 deletions(-)
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra114/include/soc}/flow.h (67%)
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/flow.h (93%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/flow.h (85%)
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/flow.h (90%)
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra30/include/soc}/flow.h (67%)
arch/arm/mach-tegra/powergate.c +1 -1
index 49723e88cc56..04205bb10cbb 100644
@@ -9,9 +9,9 @@
 
 #include <asm/io.h>
 #include <asm/types.h>
-#include <asm/arch/flow.h>
 #include <asm/arch/tegra.h>
 #include <mach/powergate.h>
+#include <soc/flow.h>
 
 #define PWRGATE_TOGGLE 0x30
 #define  PWRGATE_TOGGLE_START (1 << 8)
arch/arm/mach-tegra/tegra114/cpu.c +1 -1
index 41e337fcfb57..c06e632bb36a 100644
@@ -8,10 +8,10 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
+#include <soc/flow.h>
 #include "../cpu.h"
 #include "../pmc.h"
 
arch/arm/mach-tegra/tegra114/include/soc/flow.h renamed from arch/arm/include/asm/arch-tegra30/flow.h +4 -4
similarity index 67%
rename from arch/arm/include/asm/arch-tegra30/flow.h
rename to arch/arm/mach-tegra/tegra114/include/soc/flow.h
index 73cb0eecdcdc..781ac57516ff 100644
@@ -1,11 +1,11 @@
 /*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
 
-#ifndef _TEGRA30_FLOW_H_
-#define _TEGRA30_FLOW_H_
+#ifndef _TEGRA114_FLOW_H
+#define _TEGRA114_FLOW_H
 
 struct flow_ctlr {
 	u32 halt_cpu_events;
@@ -22,4 +22,4 @@ struct flow_ctlr {
 	u32 cluster_control;
 };
 
-#endif	/* _TEGRA30_FLOW_H_ */
+#endif
arch/arm/mach-tegra/tegra124/cpu.c +1 -1
index e8c8c507c404..527c4a186e68 100644
@@ -8,10 +8,10 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
+#include <soc/flow.h>
 #include "../cpu.h"
 #include "../pmc.h"
 
arch/arm/mach-tegra/tegra124/include/soc/flow.h renamed from arch/arm/include/asm/arch-tegra124/flow.h +3 -3
similarity index 93%
rename from arch/arm/include/asm/arch-tegra124/flow.h
rename to arch/arm/mach-tegra/tegra124/include/soc/flow.h
index 3f70fb190527..a96eeb9217aa 100644
@@ -5,8 +5,8 @@
  * SPDX-License-Identifier:     GPL-2.0+
  */
 
-#ifndef _TEGRA124_FLOW_H_
-#define _TEGRA124_FLOW_H_
+#ifndef _TEGRA124_FLOW_H
+#define _TEGRA124_FLOW_H
 
 struct flow_ctlr {
 	u32 halt_cpu_events;	/* offset 0x00 */
@@ -49,4 +49,4 @@ enum {
 	RAM_REPAIR_STS = 0x1 << 1,
 };
 
-#endif	/*  _TEGRA124_FLOW_H_ */
+#endif
arch/arm/mach-tegra/tegra124/psci.c +1 -1
index b6d99c7740c7..27f9e60e1372 100644
@@ -9,8 +9,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/psci.h>
-#include <asm/arch/flow.h>
 #include <mach/powergate.h>
+#include <soc/flow.h>
 #include "../cpu.h"
 #include "../pmc.h"
 
arch/arm/mach-tegra/tegra20/include/soc/flow.h renamed from arch/arm/include/asm/arch-tegra20/flow.h +2 -2
similarity index 85%
rename from arch/arm/include/asm/arch-tegra20/flow.h
rename to arch/arm/mach-tegra/tegra20/include/soc/flow.h
index e7df5bbb906c..b8c55b8317f5 100644
@@ -5,8 +5,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#ifndef _FLOW_H_
-#define _FLOW_H_
+#ifndef _TEGRA20_FLOW_H
+#define _TEGRA20_FLOW_H
 
 struct flow_ctlr {
 	u32	halt_cpu_events;
arch/arm/mach-tegra/tegra20/warmboot_avp.c +1 -1
index f204582b99b8..ace6e8d4f59b 100644
@@ -8,10 +8,10 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/flow.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
+#include <soc/flow.h>
 #include "../apb_misc.h"
 #include "../cpu.h"
 #include "../pmc.h"
arch/arm/mach-tegra/tegra210/include/soc/flow.h renamed from arch/arm/include/asm/arch-tegra210/flow.h +3 -3
similarity index 90%
rename from arch/arm/include/asm/arch-tegra210/flow.h
rename to arch/arm/mach-tegra/tegra210/include/soc/flow.h
index e4ede6a81500..b3b188fe7399 100644
@@ -5,8 +5,8 @@
  * SPDX-License-Identifier:     GPL-2.0+
  */
 
-#ifndef _TEGRA210_FLOW_H_
-#define _TEGRA210_FLOW_H_
+#ifndef _TEGRA210_FLOW_H
+#define _TEGRA210_FLOW_H
 
 struct flow_ctlr {
 	u32 halt_cpu_events;	/* offset 0x00 */
@@ -28,4 +28,4 @@ struct flow_ctlr {
 	u32 ram_repair;		/* offset 0x40 */
 };
 
-#endif /*  _TEGRA210_FLOW_H_ */
+#endif
arch/arm/mach-tegra/tegra30/cpu.c +1 -1
index 392c8d3bb76e..f7cffb7d5106 100644
@@ -7,10 +7,10 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/flow.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <mach/tegra_i2c.h>
+#include <soc/flow.h>
 #include "../cpu.h"
 #include "../pmc.h"
 
arch/arm/mach-tegra/tegra30/include/soc/flow.h renamed from arch/arm/include/asm/arch-tegra114/flow.h +4 -4
similarity index 67%
rename from arch/arm/include/asm/arch-tegra114/flow.h
rename to arch/arm/mach-tegra/tegra30/include/soc/flow.h
index 2e4045fc72d4..a51fd171fc61 100644
@@ -1,11 +1,11 @@
 /*
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
 
-#ifndef _TEGRA114_FLOW_H_
-#define _TEGRA114_FLOW_H_
+#ifndef _TEGRA30_FLOW_H
+#define _TEGRA30_FLOW_H
 
 struct flow_ctlr {
 	u32 halt_cpu_events;
@@ -22,4 +22,4 @@ struct flow_ctlr {
 	u32 cluster_control;
 };
 
-#endif	/* _TEGRA114_FLOW_H_ */
+#endif
Signature · 1 line
2.8.1
#112 lore raw

PATCH 34/60 ARM: tegra: move flow.h

Quoted 19 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there. Since the definitions are used by code in mach-tegra/ itself, not just in SoC-specific mach-tegra/tegraNNN/, and the content varies per SoC, we need to put it in the (somewhat isolated) <soc/> include directory rather than in mach-tegra/ directly.

---
 arch/arm/mach-tegra/powergate.c                                   | 2 +-
 arch/arm/mach-tegra/tegra114/cpu.c                                | 2 +-
 .../asm/arch-tegra30 => mach-tegra/tegra114/include/soc}/flow.h   | 8 ++++----
 arch/arm/mach-tegra/tegra124/cpu.c                                | 2 +-
 .../asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/flow.h  | 6 +++---
 arch/arm/mach-tegra/tegra124/psci.c                               | 2 +-
 .../asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/flow.h    | 4 ++--
 arch/arm/mach-tegra/tegra20/warmboot_avp.c                        | 2 +-
 .../asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/flow.h  | 6 +++---
Quoted 8 lines
 arch/arm/mach-tegra/tegra30/cpu.c                                 | 2 +-
 .../asm/arch-tegra114 => mach-tegra/tegra30/include/soc}/flow.h   | 8 ++++----
 11 files changed, 22 insertions(+), 22 deletions(-)
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra114/include/soc}/flow.h (67%)
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/flow.h (93%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/flow.h (85%)
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/flow.h (90%)
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra30/include/soc}/flow.h (67%)
#113 lore raw

PATCH 35/60 nyan-big: remove direct MC register access

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

Equivalent code is already present in the core Tegra board file, so there's no point repeating it here. This removes the only use of <asm/arch/mc.h> from outside arch/arm/mach-tegra/.

---
 arch/arm/mach-tegra/gpu.c        |  1 +
 board/nvidia/nyan-big/nyan-big.c | 13 -------------
 2 files changed, 1 insertion(+), 13 deletions(-)
arch/arm/mach-tegra/gpu.c +1 -0
index 0da681bfe927..172514204b1d 100644
@@ -20,6 +20,7 @@ void tegra_gpu_config(void)
 	struct mc_ctlr *mc = (struct mc_ctlr *)NV_PA_MC_BASE;
 
 	/* Turn VPR off */
+	writel(0, &mc->mc_video_protect_bom);
 	writel(0, &mc->mc_video_protect_size_mb);
 	writel(TEGRA_MC_VIDEO_PROTECT_REG_WRITE_ACCESS_DISABLED,
 	       &mc->mc_video_protect_reg_ctrl);
board/nvidia/nyan-big/nyan-big.c +0 -13
index efd3c18ba740..db2874ed93ac 100644
@@ -14,7 +14,6 @@
 #include <asm/io.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/clock.h>
-#include <asm/arch/mc.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <mach/tegra_gpio.h>
 #include "pinmux-config-nyan-big.h"
@@ -65,17 +64,6 @@ int tegra_lcd_pmic_init(int board_id)
 	return 0;
 }
 
-/* Setup required information for Linux kernel */
-static void setup_kernel_info(void)
-{
-	struct mc_ctlr *mc = (void *)NV_PA_MC_BASE;
-
-	/* The kernel graphics driver needs this region locked down */
-	writel(0, &mc->mc_video_protect_bom);
-	writel(0, &mc->mc_video_protect_size_mb);
-	writel(1, &mc->mc_video_protect_reg_ctrl);
-}
-
 /*
  * We need to take ALL audio devices conntected to AHUB (AUDIO, APBIF,
  * I2S, DAM, AMX, ADX, SPDIF, AFC) out of reset and enable the clocks.
@@ -123,7 +111,6 @@ int nvidia_board_init(void)
 
 	/* For external MAX98090 audio codec */
 	clock_external_output(1);
-	setup_kernel_info();
 	enable_required_clocks();
 
 	return 0;
Signature · 1 line
2.8.1
#114 lore raw

PATCH 35/60 nyan-big: remove direct MC register access

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Equivalent code is already present in the core Tegra board file, so there's no point repeating it here. This removes the only use of <asm/arch/mc.h> from outside arch/arm/mach-tegra/.

---
 arch/arm/mach-tegra/gpu.c        |  1 +
 board/nvidia/nyan-big/nyan-big.c | 13 -------------
 2 files changed, 1 insertion(+), 13 deletions(-)
#115 lore raw

PATCH 36/60 ARM: tegra: move mc.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there. Since the definitions are used by code in mach-tegra/ itself, not just in SoC-specific mach-tegra/tegraNNN/, and the content varies per SoC, we need to put it in the (somewhat isolated) <soc/> include directory rather than in mach-tegra/ directly.

---
 arch/arm/mach-tegra/ap.c                                                | 2 +-
 arch/arm/mach-tegra/board.c                                             | 2 +-
 arch/arm/mach-tegra/gpu.c                                               | 2 +-
 .../{include/asm/arch-tegra114 => mach-tegra/tegra114/include/soc}/mc.h | 2 +-
 .../{include/asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/mc.h | 0
 .../{include/asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/mc.h   | 2 +-
 .../{include/asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/mc.h | 0
 .../{include/asm/arch-tegra30 => mach-tegra/tegra30/include/soc}/mc.h   | 2 +-
 8 files changed, 6 insertions(+), 6 deletions(-)
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra114/include/soc}/mc.h (97%)
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/mc.h (100%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/mc.h (97%)
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/mc.h (100%)
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra30/include/soc}/mc.h (97%)
arch/arm/mach-tegra/ap.c +1 -1
index 4cb6367cd0a4..a200010e2937 100644
@@ -11,9 +11,9 @@
 #include <linux/bug.h>
 #include <asm/io.h>
 #include <asm/arch/gp_padctrl.h>
-#include <asm/arch/mc.h>
 #include <asm/arch-tegra/clock.h>
 #include <asm/arch-tegra/tegra.h>
+#include <soc/mc.h>
 #include "cpu.h"
 #include "fuse.h"
 #include "pmc.h"
arch/arm/mach-tegra/board.c +1 -1
index 87a9b5266804..71eb1a5d1b63 100644
@@ -12,9 +12,9 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
-#include <asm/arch/mc.h>
 #include <asm/arch/tegra.h>
 #include <mach/board.h>
+#include <soc/mc.h>
 #include "pmc.h"
 
 void save_boot_params_ret(void);
arch/arm/mach-tegra/gpu.c +1 -1
index 172514204b1d..36204f54e4c9 100644
@@ -10,7 +10,7 @@
 #include <fdt_support.h>
 #include <asm/io.h>
 #include <asm/arch/tegra.h>
-#include <asm/arch/mc.h>
+#include <soc/mc.h>
 #include "gpu.h"
 
 static bool _configured;
arch/arm/mach-tegra/tegra114/include/soc/mc.h renamed from arch/arm/include/asm/arch-tegra114/mc.h +1 -1
similarity index 97%
rename from arch/arm/include/asm/arch-tegra114/mc.h
rename to arch/arm/mach-tegra/tegra114/include/soc/mc.h
index 044b1e0b3990..6690f0435a95 100644
@@ -1,5 +1,5 @@
 /*
- *  (C) Copyright 2014
+ *  (C) Copyright 2014-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
arch/arm/mach-tegra/tegra124/include/soc/mc.h renamed from arch/arm/include/asm/arch-tegra124/mc.h +0 -0
similarity index 100%
rename from arch/arm/include/asm/arch-tegra124/mc.h
rename to arch/arm/mach-tegra/tegra124/include/soc/mc.h
arch/arm/mach-tegra/tegra20/include/soc/mc.h renamed from arch/arm/include/asm/arch-tegra20/mc.h +1 -1
similarity index 97%
rename from arch/arm/include/asm/arch-tegra20/mc.h
rename to arch/arm/mach-tegra/tegra20/include/soc/mc.h
index 9c6e3ffb6f44..d85ceb6b20d7 100644
@@ -1,5 +1,5 @@
 /*
- *  (C) Copyright 2014
+ *  (C) Copyright 2014-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
arch/arm/mach-tegra/tegra210/include/soc/mc.h renamed from arch/arm/include/asm/arch-tegra210/mc.h +0 -0
similarity index 100%
rename from arch/arm/include/asm/arch-tegra210/mc.h
rename to arch/arm/mach-tegra/tegra210/include/soc/mc.h
arch/arm/mach-tegra/tegra30/include/soc/mc.h renamed from arch/arm/include/asm/arch-tegra30/mc.h +1 -1
similarity index 97%
rename from arch/arm/include/asm/arch-tegra30/mc.h
rename to arch/arm/mach-tegra/tegra30/include/soc/mc.h
index 242a1fc64b9b..99ea0f22125d 100644
@@ -1,5 +1,5 @@
 /*
- *  (C) Copyright 2014
+ *  (C) Copyright 2014-2016
  *  NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:	GPL-2.0+
Signature · 1 line
2.8.1
#116 lore raw

PATCH 36/60 ARM: tegra: move mc.h

Quoted 9 lines · Stephen Warren

From: Stephen Warren <[email protected]>

This header is only needed by code local to mach-tegra, so move it there. Since the definitions are used by code in mach-tegra/ itself, not just in SoC-specific mach-tegra/tegraNNN/, and the content varies per SoC, we need to put it in the (somewhat isolated) <soc/> include directory rather than in mach-tegra/ directly.

Quoted 15 lines
---
 arch/arm/mach-tegra/ap.c                                                | 2 +-
 arch/arm/mach-tegra/board.c                                             | 2 +-
 arch/arm/mach-tegra/gpu.c                                               | 2 +-
 .../{include/asm/arch-tegra114 => mach-tegra/tegra114/include/soc}/mc.h | 2 +-
 .../{include/asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/mc.h | 0
 .../{include/asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/mc.h   | 2 +-
 .../{include/asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/mc.h | 0
 .../{include/asm/arch-tegra30 => mach-tegra/tegra30/include/soc}/mc.h   | 2 +-
 8 files changed, 6 insertions(+), 6 deletions(-)
 rename arch/arm/{include/asm/arch-tegra114 => mach-tegra/tegra114/include/soc}/mc.h (97%)
 rename arch/arm/{include/asm/arch-tegra124 => mach-tegra/tegra124/include/soc}/mc.h (100%)
 rename arch/arm/{include/asm/arch-tegra20 => mach-tegra/tegra20/include/soc}/mc.h (97%)
 rename arch/arm/{include/asm/arch-tegra210 => mach-tegra/tegra210/include/soc}/mc.h (100%)
 rename arch/arm/{include/asm/arch-tegra30 => mach-tegra/tegra30/include/soc}/mc.h (97%)
#117 lore raw

PATCH 37/60 ARM: tegra: move SDIOCFG_DRV* to pinmux.h

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

These defines are used with APIs in pinmux.h, so it makes sense to put them into the same header. It also allows all includes of gp_padctrl.h to be removed from code outside arch/arm/mach-tegra/.

---
 arch/arm/include/asm/arch-tegra114/gp_padctrl.h | 8 +-------
 arch/arm/include/asm/arch-tegra114/pinmux.h     | 8 +++++++-
 arch/arm/include/asm/arch-tegra124/gp_padctrl.h | 8 +-------
 arch/arm/include/asm/arch-tegra124/pinmux.h     | 8 +++++++-
 arch/arm/include/asm/arch-tegra210/gp_padctrl.h | 8 +-------
 arch/arm/include/asm/arch-tegra210/pinmux.h     | 8 +++++++-
 arch/arm/include/asm/arch-tegra30/gp_padctrl.h  | 8 +-------
 arch/arm/include/asm/arch-tegra30/pinmux.h      | 8 +++++++-
 board/avionic-design/common/tamonten-ng.c       | 1 -
 board/nvidia/cardhu/cardhu.c                    | 1 -
 board/nvidia/dalmore/dalmore.c                  | 3 +--
 board/toradex/apalis_t30/apalis_t30.c           | 1 -
 12 files changed, 33 insertions(+), 37 deletions(-)
arch/arm/include/asm/arch-tegra114/gp_padctrl.h +1 -7
index 21fa4f2d4233..24416f4a5c52 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -64,10 +64,4 @@ struct apb_misc_gp_ctlr {
 	u32	aocfg0;		/* 0x1AC: APB_MISC_GP_AOCFG0PADCTRL */
 };
 
-/* SDMMC1/3 settings from section 27.5 of T114 TRM */
-#define SDIOCFG_DRVUP_SLWF	0
-#define SDIOCFG_DRVDN_SLWR	0
-#define SDIOCFG_DRVUP		0x24
-#define SDIOCFG_DRVDN		0x14
-
 #endif	/* _TEGRA114_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra114/pinmux.h +7 -1
index 38d8b9cf4d03..c96fd096695b 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier: GPL-2.0+
  */
@@ -313,6 +313,12 @@ enum pmux_func {
 	PMUX_FUNC_COUNT,
 };
 
+/* SDMMC1/3 settings from section 27.5 of T114 TRM */
+#define SDIOCFG_DRVUP_SLWF	0
+#define SDIOCFG_DRVDN_SLWR	0
+#define SDIOCFG_DRVUP		0x24
+#define SDIOCFG_DRVDN		0x14
+
 #define TEGRA_PMX_SOC_DRV_GROUP_BASE_REG 0x868
 #define TEGRA_PMX_SOC_HAS_IO_CLAMPING
 #define TEGRA_PMX_SOC_HAS_DRVGRPS
arch/arm/include/asm/arch-tegra124/gp_padctrl.h +1 -7
index 440cbbfa3ed3..406edd0d7ea6 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2013
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -65,10 +65,4 @@ struct apb_misc_gp_ctlr {
 	u32	aocfg0;		/* 0x1AC: APB_MISC_GP_AOCFG0PADCTRL */
 };
 
-/* SDMMC1/3 settings from section 27.5 of T114 TRM */
-#define SDIOCFG_DRVUP_SLWF	0
-#define SDIOCFG_DRVDN_SLWR	0
-#define SDIOCFG_DRVUP		0x24
-#define SDIOCFG_DRVDN		0x14
-
 #endif	/* _TEGRA124_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra124/pinmux.h +7 -1
index 9fcbb0f80b4b..31b921f4ae71 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013-2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier: GPL-2.0+
  */
@@ -342,6 +342,12 @@ enum pmux_func {
 	PMUX_FUNC_COUNT,
 };
 
+/* SDMMC1/3 settings from section 27.5 of T114 TRM */
+#define SDIOCFG_DRVUP_SLWF	0
+#define SDIOCFG_DRVDN_SLWR	0
+#define SDIOCFG_DRVUP		0x24
+#define SDIOCFG_DRVDN		0x14
+
 #define TEGRA_PMX_SOC_DRV_GROUP_BASE_REG 0x868
 #define TEGRA_PMX_SOC_MIPIPADCTRL_BASE_REG 0x820
 #define TEGRA_PMX_SOC_HAS_IO_CLAMPING
arch/arm/include/asm/arch-tegra210/gp_padctrl.h +1 -7
index fb69baf98678..ead620534c7d 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2010-2015
+ * (C) Copyright 2010-2016
  * NVIDIA Corporation <www.nvidia.com>
  *
  * SPDX-License-Identifier:     GPL-2.0+
@@ -65,10 +65,4 @@ struct apb_misc_gp_ctlr {
 	u32	aocfg0;		/* 0x1AC: APB_MISC_GP_AOCFG0PADCTRL */
 };
 
-/* SDMMC1/3 settings from section 27.5 of T114 TRM */
-#define SDIOCFG_DRVUP_SLWF	0
-#define SDIOCFG_DRVDN_SLWR	0
-#define SDIOCFG_DRVUP		0x24
-#define SDIOCFG_DRVDN		0x14
-
 #endif	/* _TEGRA210_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra210/pinmux.h +7 -1
index af3b55f0d7b8..4772d96101c9 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier: GPL-2.0+
  */
@@ -404,6 +404,12 @@ enum pmux_func {
 	PMUX_FUNC_COUNT,
 };
 
+/* SDMMC1/3 settings from section 27.5 of T114 TRM */
+#define SDIOCFG_DRVUP_SLWF	0
+#define SDIOCFG_DRVDN_SLWR	0
+#define SDIOCFG_DRVUP		0x24
+#define SDIOCFG_DRVDN		0x14
+
 #define TEGRA_PMX_SOC_DRV_GROUP_BASE_REG 0x8d4
 #define TEGRA_PMX_SOC_HAS_IO_CLAMPING
 #define TEGRA_PMX_SOC_HAS_DRVGRPS
arch/arm/include/asm/arch-tegra30/gp_padctrl.h +1 -7
index 1c5017686ce9..5453555d3ea3 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -46,10 +46,4 @@ struct apb_misc_gp_ctlr {
 	u32	sdio1cfg;	/* 0xEC: APB_MISC_GP_SDIO1CFGPADCTRL */
 };
 
-/* SDMMC1/3 settings from section 24.6 of T30 TRM */
-#define SDIOCFG_DRVUP_SLWF	1
-#define SDIOCFG_DRVDN_SLWR	1
-#define SDIOCFG_DRVUP		0x2E
-#define SDIOCFG_DRVDN		0x2A
-
 #endif	/* _TEGRA30_GP_PADCTRL_H_ */
arch/arm/include/asm/arch-tegra30/pinmux.h +7 -1
index 3358bf7ce386..6f4e2899b963 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION. All rights reserved.
  *
  * SPDX-License-Identifier: GPL-2.0+
  */
@@ -391,6 +391,12 @@ enum pmux_func {
 	PMUX_FUNC_COUNT,
 };
 
+/* SDMMC1/3 settings from section 24.6 of T30 TRM */
+#define SDIOCFG_DRVUP_SLWF	1
+#define SDIOCFG_DRVDN_SLWR	1
+#define SDIOCFG_DRVUP		0x2E
+#define SDIOCFG_DRVDN		0x2A
+
 #define TEGRA_PMX_SOC_DRV_GROUP_BASE_REG 0x868
 #define TEGRA_PMX_SOC_HAS_DRVGRPS
 #define TEGRA_PMX_GRPS_HAVE_LPMD
board/avionic-design/common/tamonten-ng.c +0 -1
index aa1fd0ebce1e..6bff3285c73c 100644
@@ -12,7 +12,6 @@
 #include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/gp_padctrl.h>
 #include "pinmux-config-tamonten-ng.h"
 
 #define PMU_I2C_ADDRESS		0x2D
board/nvidia/cardhu/cardhu.c +0 -1
index ff46e0cf0419..edfe960428ac 100644
@@ -11,7 +11,6 @@
 #include <dt-bindings/gpio/tegra-gpio.h>
 #include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/gp_padctrl.h>
 #include "pinmux-config-cardhu.h"
 
 #define PMU_I2C_ADDRESS		0x2D
board/nvidia/dalmore/dalmore.c +1 -2
index e4c4bfbc6809..09adc74e0ede 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2010-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -7,7 +7,6 @@
 #include <common.h>
 #include <dm.h>
 #include <asm/arch/pinmux.h>
-#include <asm/arch/gp_padctrl.h>
 #include "pinmux-config-dalmore.h"
 #include <i2c.h>
 
board/toradex/apalis_t30/apalis_t30.c +0 -1
index 8fdee023ee8a..e2a40db1afdd 100644
@@ -7,7 +7,6 @@
  */
 
 #include <common.h>
-#include <asm/arch/gp_padctrl.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch-tegra/tegra.h>
 #include <asm/gpio.h>
Signature · 1 line
2.8.1
#118 lore raw

PATCH 37/60 ARM: tegra: move SDIOCFG_DRV* to pinmux.h

Quoted 7 lines · Stephen Warren

From: Stephen Warren <[email protected]>

These defines are used with APIs in pinmux.h, so it makes sense to put them into the same header. It also allows all includes of gp_padctrl.h to be removed from code outside arch/arm/mach-tegra/.

Quoted 14 lines
---
 arch/arm/include/asm/arch-tegra114/gp_padctrl.h | 8 +-------
 arch/arm/include/asm/arch-tegra114/pinmux.h     | 8 +++++++-
 arch/arm/include/asm/arch-tegra124/gp_padctrl.h | 8 +-------
 arch/arm/include/asm/arch-tegra124/pinmux.h     | 8 +++++++-
 arch/arm/include/asm/arch-tegra210/gp_padctrl.h | 8 +-------
 arch/arm/include/asm/arch-tegra210/pinmux.h     | 8 +++++++-
 arch/arm/include/asm/arch-tegra30/gp_padctrl.h  | 8 +-------
 arch/arm/include/asm/arch-tegra30/pinmux.h      | 8 +++++++-
 board/avionic-design/common/tamonten-ng.c       | 1 -
 board/nvidia/cardhu/cardhu.c                    | 1 -
 board/nvidia/dalmore/dalmore.c                  | 3 +--
 board/toradex/apalis_t30/apalis_t30.c           | 1 -
 12 files changed, 33 insertions(+), 37 deletions(-)
#119 lore raw

PATCH 38/60 ARM: tegra: remove tegra_get_chip()

In reply to Stephen Warren

From: Stephen Warren <[email protected]>

U-Boot is compiled for a single board, which in turn uses a specific SoC. There's no need to make runtime decisions based on SoC ID. While there's certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all runtime decisions should likely be based on DT anyway.

---
 arch/arm/mach-tegra/ap.c               | 106 ++++++++++-----------------------
 arch/arm/mach-tegra/cache.c            |  20 +++----
 arch/arm/mach-tegra/cpu.c              |  16 ++---
 arch/arm/mach-tegra/cpu.h              |   6 --
 arch/arm/mach-tegra/tegra20/warmboot.c |  20 ++-----
 5 files changed, 51 insertions(+), 117 deletions(-)
arch/arm/mach-tegra/ap.c +31 -75
index a200010e2937..a8e3e8b7dfcb 100644
@@ -10,7 +10,6 @@
 #include <common.h>
 #include <linux/bug.h>
 #include <asm/io.h>
-#include <asm/arch/gp_padctrl.h>
 #include <asm/arch-tegra/clock.h>
 #include <asm/arch-tegra/tegra.h>
 #include <soc/mc.h>
@@ -19,23 +18,6 @@
 #include "pmc.h"
 #include "scu.h"
 
-int tegra_get_chip(void)
-{
-	int rev;
-	struct apb_misc_gp_ctlr *gp =
-		(struct apb_misc_gp_ctlr *)NV_PA_APB_MISC_GP_BASE;
-
-	/*
-	 * This is undocumented, Chip ID is bits 15:8 of the register
-	 * APB_MISC + 0x804, and has value 0x20 for Tegra20, 0x30 for
-	 * Tegra30, 0x35 for T114, and 0x40 for Tegra124.
-	 */
-	rev = (readl(&gp->hidrev) & HIDREV_CHIPID_MASK) >> HIDREV_CHIPID_SHIFT;
-	debug("%s: CHIPID is 0x%02X\n", __func__, rev);
-
-	return rev;
-}
-
 int tegra_get_sku_info(void)
 {
 	int sku_id;
@@ -49,74 +31,47 @@ int tegra_get_sku_info(void)
 
 int tegra_get_chip_sku(void)
 {
-	uint sku_id, chip_id;
+#ifdef CONFIG_TEGRA20
+	uint sku_id;
 
-	chip_id = tegra_get_chip();
 	sku_id = tegra_get_sku_info();
-
-	switch (chip_id) {
-	case CHIPID_TEGRA20:
-		switch (sku_id) {
-		case SKU_ID_T20_7:
-		case SKU_ID_T20:
-			return TEGRA_SOC_T20;
-		case SKU_ID_T25SE:
-		case SKU_ID_AP25:
-		case SKU_ID_T25:
-		case SKU_ID_AP25E:
-		case SKU_ID_T25E:
-			return TEGRA_SOC_T25;
-		}
-		break;
-	case CHIPID_TEGRA30:
-		switch (sku_id) {
-		case SKU_ID_T33:
-		case SKU_ID_T30:
-		case SKU_ID_TM30MQS_P_A3:
-		default:
-			return TEGRA_SOC_T30;
-		}
-		break;
-	case CHIPID_TEGRA114:
-		switch (sku_id) {
-		case SKU_ID_T114_ENG:
-		case SKU_ID_T114_1:
-		default:
-			return TEGRA_SOC_T114;
-		}
-		break;
-	case CHIPID_TEGRA124:
-		switch (sku_id) {
-		case SKU_ID_T124_ENG:
-		default:
-			return TEGRA_SOC_T124;
-		}
-		break;
-	case CHIPID_TEGRA210:
-		switch (sku_id) {
-		case SKU_ID_T210_ENG:
-		default:
-			return TEGRA_SOC_T210;
-		}
-		break;
+	switch (sku_id) {
+	case SKU_ID_T20_7:
+	case SKU_ID_T20:
+		return TEGRA_SOC_T20;
+	case SKU_ID_T25SE:
+	case SKU_ID_AP25:
+	case SKU_ID_T25:
+	case SKU_ID_AP25E:
+	case SKU_ID_T25E:
+		return TEGRA_SOC_T25;
+	default:
+		/* unknown chip/sku id */
+		printf("ERROR: UNKNOWN SKU ID 0x%02X\n", sku_id);
+		return TEGRA_SOC_UNKNOWN;
 	}
-
-	/* unknown chip/sku id */
-	printf("%s: ERROR: UNKNOWN CHIP/SKU ID COMBO (0x%02X/0x%02X)\n",
-		__func__, chip_id, sku_id);
-	return TEGRA_SOC_UNKNOWN;
+#endif
+#ifdef CONFIG_TEGRA30
+	return TEGRA_SOC_T30;
+#endif
+#ifdef CONFIG_TEGRA114
+	return TEGRA_SOC_T114;
+#endif
+#ifdef CONFIG_TEGRA124
+	return TEGRA_SOC_T124;
+#endif
+#ifdef CONFIG_TEGRA210
+	return TEGRA_SOC_T210;
+#endif
 }
 
 #ifndef CONFIG_ARM64
 static void enable_scu(void)
 {
+#ifdef CONFIG_TEGRA20
 	struct scu_ctlr *scu = (struct scu_ctlr *)NV_PA_ARM_PERIPHBASE;
 	u32 reg;
 
-	/* Only enable the SCU on T20/T25 */
-	if (tegra_get_chip() != CHIPID_TEGRA20)
-		return;
-
 	/* If SCU already setup/enabled, return */
 	if (readl(&scu->scu_ctrl) & SCU_CTRL_ENABLE)
 		return;
@@ -128,6 +83,7 @@ static void enable_scu(void)
 	reg = readl(&scu->scu_ctrl);
 	reg |= SCU_CTRL_ENABLE;
 	writel(reg, &scu->scu_ctrl);
+#endif
 }
 
 static u32 get_odmdata(void)
arch/arm/mach-tegra/cache.c +9 -11
index b93814fcb96b..a41a7b9e2868 100644
@@ -8,31 +8,29 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/gp_padctrl.h>
 #include "cpu.h"
 
 #ifndef CONFIG_ARM64
 void config_cache(void)
 {
-	u32 reg = 0;
-
 	/* enable SMP mode and FW for CPU0, by writing to Auxiliary Ctl reg */
 	asm volatile(
 		"mrc p15, 0, r0, c1, c0, 1\n"
 		"orr r0, r0, #0x41\n"
 		"mcr p15, 0, r0, c1, c0, 1\n");
 
-	/* Currently, only Tegra114+ needs this L2 cache change to boot Linux */
-	if (tegra_get_chip() < CHIPID_TEGRA114)
-		return;
-
+#if defined(CONFIG_TEGRA114) || defined(CONFIG_TEGRA124)
 	/*
 	 * Systems with an architectural L2 cache must not use the PL310.
 	 * Config L2CTLR here for a data RAM latency of 3 cycles.
 	 */
-	asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
-	reg &= ~7;
-	reg |= 2;
-	asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	{
+		u32 reg;
+		asm("mrc p15, 1, %0, c9, c0, 2" : "=r" (reg));
+		reg &= ~7;
+		reg |= 2;
+		asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
+	}
+#endif
 }
 #endif
arch/arm/mach-tegra/cpu.c +6 -10
index 3562a2d2188a..cc60908677a1 100644
@@ -172,7 +172,6 @@ int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
 		u32 divp, u32 cpcon)
 {
 	struct clk_pll_info *pllinfo = &tegra_pll_info_table[CLOCK_ID_XCPU];
-	int chip = tegra_get_chip();
 	u32 reg;
 	debug("%s entry\n", __func__);
 
@@ -189,11 +188,12 @@ int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
 	reg |= (divn << pllinfo->n_shift) | (divp << pllinfo->p_shift);
 	writel(reg, &pll->pll_base);
 
+	reg = 0;
+
+#if defined(CONFIG_TEGRA20) || defined(CONFIG_TEGRA30)
 	/* Set cpcon to PLLX_MISC */
-	if (chip == CHIPID_TEGRA20 || chip == CHIPID_TEGRA30)
-		reg = (cpcon << pllinfo->kcp_shift);
-	else
-		reg = 0;
+	reg |= (cpcon << pllinfo->kcp_shift);
+#endif
 
 	/*
 	 * TODO(twarren at nvidia.com) Check which SoCs use DCCON
@@ -230,15 +230,11 @@ void init_pllx(void)
 {
 	struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
 	struct clk_pll_simple *pll = &clkrst->crc_pll_simple[SIMPLE_PLLX];
-	int soc_type, sku_info, chip_sku;
+	int sku_info, chip_sku;
 	enum clock_osc_freq osc;
 	struct clk_pll_table *sel;
 	debug("%s entry\n", __func__);
 
-	/* get SOC (chip) type */
-	soc_type = tegra_get_chip();
-	debug("%s: SoC = 0x%02X\n", __func__, soc_type);
-
 	/* get SKU info */
 	sku_info = tegra_get_sku_info();
 	debug("%s: SKU info byte = 0x%02X\n", __func__, sku_info);
arch/arm/mach-tegra/cpu.h +0 -6
index f1f5b179c198..ee4f7868baf7 100644
@@ -64,12 +64,6 @@ void powerup_cpu(void);
 void reset_A9_cpu(int reset);
 void start_cpu(u32 reset_vector);
 /**
- * Returns the pure SOC (chip ID) from the HIDREV register
- *
- * @return	SOC ID - see CHIPID_TEGRAxx...
- */
-int tegra_get_chip(void);
-/**
  * Returns the SKU ID from the sku_info register
  *
  * @return	SKU ID - see SKU_ID_Txx...
arch/arm/mach-tegra/tegra20/warmboot.c +5 -15
index 9d67bdef494a..1159f05a5dc3 100644
@@ -242,22 +242,12 @@ static int ap20_is_production_mode(void)
 
 static enum fuse_operating_mode fuse_get_operation_mode(void)
 {
-	u32 chip_id;
-	struct apb_misc_gp_ctlr *gp =
-		(struct apb_misc_gp_ctlr *)NV_PA_APB_MISC_GP_BASE;
-
-	chip_id = (readl(&gp->hidrev) & HIDREV_CHIPID_MASK) >>
-			HIDREV_CHIPID_SHIFT;
-	if (chip_id == CHIPID_TEGRA20) {
-		if (ap20_is_odm_production_mode()) {
-			printf("!! odm_production_mode is not supported !!\n");
-			return MODE_UNDEFINED;
-		} else
-			if (ap20_is_production_mode())
-				return MODE_PRODUCTION;
-			else
-				return MODE_UNDEFINED;
+	if (ap20_is_odm_production_mode()) {
+		printf("!! odm_production_mode is not supported !!\n");
+		return MODE_UNDEFINED;
 	}
+	if (ap20_is_production_mode())
+		return MODE_PRODUCTION;
 	return MODE_UNDEFINED;
 }
 
Signature · 1 line
2.8.1
#120 lore raw

PATCH 38/60 ARM: tegra: remove tegra_get_chip()

Hi Stephen,

Quoted 9 lines · Stephen Warren

From: Stephen Warren <[email protected]>

U-Boot is compiled for a single board, which in turn uses a specific SoC. There's no need to make runtime decisions based on SoC ID. While there's certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all runtime decisions should likely be based on DT anyway.

Quoted 8 lines
---
 arch/arm/mach-tegra/ap.c               | 106 ++++++++++-----------------------
 arch/arm/mach-tegra/cache.c            |  20 +++----
 arch/arm/mach-tegra/cpu.c              |  16 ++---
 arch/arm/mach-tegra/cpu.h              |   6 --
 arch/arm/mach-tegra/tegra20/warmboot.c |  20 ++-----
 5 files changed, 51 insertions(+), 117 deletions(-)

What exactly is missing to prevent multi-arch support? Shouldn't we head towards that rather than making it harder?

Regards,
Simon

#121 lore raw

PATCH 38/60 ARM: tegra: remove tegra_get_chip()

Quoted 21 lines · Simon Glass

Hi Stephen,

Quoted 9 lines · Stephen Warren

From: Stephen Warren <[email protected]>

U-Boot is compiled for a single board, which in turn uses a specific SoC. There's no need to make runtime decisions based on SoC ID. While there's certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all runtime decisions should likely be based on DT anyway.

Quoted 8 lines
---
  arch/arm/mach-tegra/ap.c               | 106 ++++++++++-----------------------
  arch/arm/mach-tegra/cache.c            |  20 +++----
  arch/arm/mach-tegra/cpu.c              |  16 ++---
  arch/arm/mach-tegra/cpu.h              |   6 --
  arch/arm/mach-tegra/tegra20/warmboot.c |  20 ++-----
  5 files changed, 51 insertions(+), 117 deletions(-)
Quoted 1 line

What exactly is missing to prevent multi-arch support?

In a word: everything:-)

Pretty much all decisions in core architecture code, core Tegra code, drivers, and even board files are currently made at compile time. For example, consider drivers where the register layouts are different between different SoCs; not just new fields added, but existing fields moved to different offsets. Right now, we handle this by changing the register struct definition at compile time. To support multiple chips, we'd have to either (a) link in n copies of the driver, one per register layout, or (b) rework the driver to use #defines and runtime calculations for register offsets, like the Linux kernel drivers do. Tegra USB is one example. The pinmux and clock drivers have a significantly different sets of pins/clocks/resets/... per SoC, and enums/tables describing those sets are currently configured at compile time. Some PMIC constants (e.g. vdd_cpu voltage) are configured at compile-time, and even differ per board.

Quoted 1 line

Shouldn't we head towards that rather than making it harder?

I don't see any need for that, no.

U-Boot is built for a specific board (or in some cases a set of extremely closely related set of boards, such as the RPI A/B/A+/B+). There's no need to determine almost anything at run-time since almost all information is known at compile time, with exceptions such as standardized enumerable buses such as USB, PCIe. If we support multiple HW in a single binary, it gets bloated with code that simply isn't going to be used, since all the extra code is either for a platform that the build won't be installed on (e.g. clock/pinmux tables), or is overhead to add runtime detection of which block of code to use, which simply isn't needed in the current model.

In my opinion, firmware/bootloaders run on a single specific board, whereas full-featured operating systems support multiple systems.

As an aside, I've wondered whether U-Boot should be split into multiple parts; one HW-specific binary providing various drivers (e.g. via DM-related APIs?) and the other containing just high-level user-interface code such as the shell, high-level USB/... protocols, which would only call into those APIs. Still, I don't think we're anywhere close to that, and I'm not aware that it's a goal of the project at the moment.

#122 lore raw

PATCH 38/60 ARM: tegra: remove tegra_get_chip()

Hi Stephen,

Quoted 31 lines · Stephen Warren
Quoted 25 lines · Simon Glass

Hi Stephen,

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

U-Boot is compiled for a single board, which in turn uses a specific SoC. There's no need to make runtime decisions based on SoC ID. While there's certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all runtime decisions should likely be based on DT anyway.

Quoted 8 lines
---
  arch/arm/mach-tegra/ap.c               | 106
++++++++++-----------------------
  arch/arm/mach-tegra/cache.c            |  20 +++----
  arch/arm/mach-tegra/cpu.c              |  16 ++---
  arch/arm/mach-tegra/cpu.h              |   6 --
  arch/arm/mach-tegra/tegra20/warmboot.c |  20 ++-----
  5 files changed, 51 insertions(+), 117 deletions(-)
Quoted 1 line

What exactly is missing to prevent multi-arch support?

In a word: everything:-)

Quoted 13 lines

Pretty much all decisions in core architecture code, core Tegra code, drivers, and even board files are currently made at compile time. For example, consider drivers where the register layouts are different between different SoCs; not just new fields added, but existing fields moved to different offsets. Right now, we handle this by changing the register struct definition at compile time. To support multiple chips, we'd have to either
(a) link in n copies of the driver, one per register layout, or (b) rework the driver to use #defines and runtime calculations for register offsets, like the Linux kernel drivers do. Tegra USB is one example. The pinmux and clock drivers have a significantly different sets of pins/clocks/resets/... per SoC, and enums/tables describing those sets are currently configured at compile time. Some PMIC constants (e.g. vdd_cpu voltage) are configured at compile-time, and even differ per board.

I wonder how far we would get by converting clock, pinctrl, reset to driver model drivers?

Quoted 6 lines
Quoted 2 lines

Shouldn't we head towards that rather than making it harder?

I don't see any need for that, no.

Quoted 9 lines

U-Boot is built for a specific board (or in some cases a set of extremely closely related set of boards, such as the RPI A/B/A+/B+). There's no need to determine almost anything at run-time since almost all information is known at compile time, with exceptions such as standardized enumerable buses such as USB, PCIe. If we support multiple HW in a single binary, it gets bloated with code that simply isn't going to be used, since all the extra code is either for a platform that the build won't be installed on (e.g. clock/pinmux tables), or is overhead to add runtime detection of which block of code to use, which simply isn't needed in the current model.

It's not so much that. Presumably a build for a particular board would not include support for and SoC it doesn't have. But it is still useful to build the code. For example it would be nice to have an overall Tegra build that enables all SoCs to avoid building every board.

So it is a serious question. I suspect the main impediment may be moving the clock and other core stuff to driver model.

Quoted 3 lines

In my opinion, firmware/bootloaders run on a single specific board, whereas full-featured operating systems support multiple systems.

Except when the boards are pretty similar. Also, doesn't barebox have only one build for Tegra?

Quoted 7 lines

As an aside, I've wondered whether U-Boot should be split into multiple parts; one HW-specific binary providing various drivers (e.g. via DM-related APIs?) and the other containing just high-level user-interface code such as the shell, high-level USB/... protocols, which would only call into those APIs. Still, I don't think we're anywhere close to that, and I'm not aware that it's a goal of the project at the moment.

Well it gets built as one binary, but there's a pretty clear separation in the code, at least with driver model. What's the purpose of this?

Regards,
Simon

#123 lore raw

PATCH 38/60 ARM: tegra: remove tegra_get_chip()

Quoted 47 lines · Simon Glass

Hi Stephen,

Quoted 30 lines · Stephen Warren
Quoted 25 lines · Simon Glass

Hi Stephen,

Quoted 11 lines · Stephen Warren

From: Stephen Warren <[email protected]>

U-Boot is compiled for a single board, which in turn uses a specific SoC. There's no need to make runtime decisions based on SoC ID. While there's certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all runtime decisions should likely be based on DT anyway.

Quoted 8 lines
---
   arch/arm/mach-tegra/ap.c               | 106
++++++++++-----------------------
   arch/arm/mach-tegra/cache.c            |  20 +++----
   arch/arm/mach-tegra/cpu.c              |  16 ++---
   arch/arm/mach-tegra/cpu.h              |   6 --
   arch/arm/mach-tegra/tegra20/warmboot.c |  20 ++-----
   5 files changed, 51 insertions(+), 117 deletions(-)
Quoted 1 line

What exactly is missing to prevent multi-arch support?

In a word: everything:-)

Quoted 13 lines

Pretty much all decisions in core architecture code, core Tegra code, drivers, and even board files are currently made at compile time. For example, consider drivers where the register layouts are different between different SoCs; not just new fields added, but existing fields moved to different offsets. Right now, we handle this by changing the register struct definition at compile time. To support multiple chips, we'd have to either
(a) link in n copies of the driver, one per register layout, or (b) rework the driver to use #defines and runtime calculations for register offsets, like the Linux kernel drivers do. Tegra USB is one example. The pinmux and clock drivers have a significantly different sets of pins/clocks/resets/... per SoC, and enums/tables describing those sets are currently configured at compile time. Some PMIC constants (e.g. vdd_cpu voltage) are configured at compile-time, and even differ per board.

Quoted 2 lines

I wonder how far we would get by converting clock, pinctrl, reset to driver model drivers?

Well, I expect we'll find out soon. The next SoC has radically different clock/reset mechanisms, so we'll need to switch to standardized APIs for clock/reset on Tegra to isolate drivers from those differences, and I imagine that conversion would also involve conversion to DM since any standard APIs probably assume use of DM. I haven't investigated this in detail yet though.

Quoted 14 lines
Quoted 4 lines
Quoted 1 line

Shouldn't we head towards that rather than making it harder?

I don't see any need for that, no.

Quoted 9 lines

U-Boot is built for a specific board (or in some cases a set of extremely closely related set of boards, such as the RPI A/B/A+/B+). There's no need to determine almost anything at run-time since almost all information is known at compile time, with exceptions such as standardized enumerable buses such as USB, PCIe. If we support multiple HW in a single binary, it gets bloated with code that simply isn't going to be used, since all the extra code is either for a platform that the build won't be installed on (e.g. clock/pinmux tables), or is overhead to add runtime detection of which block of code to use, which simply isn't needed in the current model.

Quoted 8 lines

It's not so much that. Presumably a build for a particular board would not include support for and SoC it doesn't have. But it is still useful to build the code. For example it would be nice to have an overall Tegra build that enables all SoCs to avoid building every board.

So it is a serious question. I suspect the main impediment may be moving the clock and other core stuff to driver model.

Yes, everything is a bit too tightly coupled at the moment, and in many cases each SoC-specific implementation exposes the same global symbols which clients use. DM or similar conversions may well solve a lot of this.

Quoted 5 lines
Quoted 2 lines

In my opinion, firmware/bootloaders run on a single specific board, whereas full-featured operating systems support multiple systems.

Except when the boards are pretty similar. Also, doesn't barebox have only one build for Tegra?

I haven't looked at Barebox much. IIRC it only supports Tegra20 and not later SoCs which could simplify things. Besides, I'm not arguing that it's impossible to make a unified binary, simply that I don't see any need to do so, except perhaps your compile-coverage suggestion.

Quoted 10 lines
Quoted 6 lines

As an aside, I've wondered whether U-Boot should be split into multiple parts; one HW-specific binary providing various drivers (e.g. via DM-related APIs?) and the other containing just high-level user-interface code such as the shell, high-level USB/... protocols, which would only call into those APIs. Still, I don't think we're anywhere close to that, and I'm not aware that it's a goal of the project at the moment.

Well it gets built as one binary, but there's a pretty clear separation in the code, at least with driver model. What's the purpose of this?

It would allow the HW-agnostic portion to be compiled once (or once for a CPU ISA) and re-used with any of the HW-/board-specific "driver" blobs. It'd get use to "single binary" for the generic stuff, but without requiring the for HW-specific code. Perhaps the generic portion could even run on top of other driver stacks if they implemented the API it needed! However, this does ignore potential feature differences in the common binary, e.g. someone might want dfu/ums commands, but someone else might not need them and hence consider them bloat. Still, those configurations would be differentiated by feature more than HW, so it might still be useful.

#124 lore raw

PATCH 38/60 ARM: tegra: remove tegra_get_chip()

Hi Stephen,

Quoted 69 lines · Stephen Warren
Quoted 64 lines · Simon Glass

Hi Stephen,

Quoted 50 lines · Stephen Warren
Quoted 30 lines · Simon Glass

Hi Stephen,

Quoted 14 lines · Stephen Warren

From: Stephen Warren <[email protected]>

U-Boot is compiled for a single board, which in turn uses a specific SoC.
There's no need to make runtime decisions based on SoC ID. While there's
certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all runtime decisions should likely be based on DT anyway.

Quoted 8 lines
---
   arch/arm/mach-tegra/ap.c               | 106
++++++++++-----------------------
   arch/arm/mach-tegra/cache.c            |  20 +++----
   arch/arm/mach-tegra/cpu.c              |  16 ++---
   arch/arm/mach-tegra/cpu.h              |   6 --
   arch/arm/mach-tegra/tegra20/warmboot.c |  20 ++-----
   5 files changed, 51 insertions(+), 117 deletions(-)
Quoted 1 line

What exactly is missing to prevent multi-arch support?

In a word: everything:-)

Pretty much all decisions in core architecture code, core Tegra code, drivers, and even board files are currently made at compile time. For example, consider drivers where the register layouts are different between
different SoCs; not just new fields added, but existing fields moved to different offsets. Right now, we handle this by changing the register struct
definition at compile time. To support multiple chips, we'd have to either
(a) link in n copies of the driver, one per register layout, or (b) rework
the driver to use #defines and runtime calculations for register offsets, like the Linux kernel drivers do. Tegra USB is one example. The pinmux

Quoted 8 lines

and
clock drivers have a significantly different sets of pins/clocks/resets/...
per SoC, and enums/tables describing those sets are currently configured at
compile time. Some PMIC constants (e.g. vdd_cpu voltage) are configured at
compile-time, and even differ per board.

Quoted 2 lines

I wonder how far we would get by converting clock, pinctrl, reset to driver model drivers?

Quoted 6 lines

Well, I expect we'll find out soon. The next SoC has radically different clock/reset mechanisms, so we'll need to switch to standardized APIs for clock/reset on Tegra to isolate drivers from those differences, and I imagine that conversion would also involve conversion to DM since any standard APIs probably assume use of DM. I haven't investigated this in detail yet though.

That sounds like a good move.

Quoted 26 lines
Quoted 26 lines
Quoted 6 lines
Quoted 2 lines

Shouldn't we head towards that rather than making it harder?

I don't see any need for that, no.

Quoted 12 lines

U-Boot is built for a specific board (or in some cases a set of extremely closely related set of boards, such as the RPI A/B/A+/B+). There's no need
to determine almost anything at run-time since almost all information is known at compile time, with exceptions such as standardized enumerable buses
such as USB, PCIe. If we support multiple HW in a single binary, it gets bloated with code that simply isn't going to be used, since all the extra code is either for a platform that the build won't be installed on (e.g. clock/pinmux tables), or is overhead to add runtime detection of which block
of code to use, which simply isn't needed in the current model.

It's not so much that. Presumably a build for a particular board would not include support for and SoC it doesn't have. But it is still useful to build the code. For example it would be nice to have an overall Tegra build that enables all SoCs to avoid building every board.

Quoted 7 lines
Quoted 2 lines

So it is a serious question. I suspect the main impediment may be moving the clock and other core stuff to driver model.

Yes, everything is a bit too tightly coupled at the moment, and in many cases each SoC-specific implementation exposes the same global symbols which clients use. DM or similar conversions may well solve a lot of this.

With a suitable API (even it if is pretty basic) the coupling can often go away. The current driver-model pinctrl/clock APIs are pretty simple, but they are effective in this regard for the SoCs I've tried.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

In my opinion, firmware/bootloaders run on a single specific board, whereas
full-featured operating systems support multiple systems.

Quoted 8 lines
Quoted 2 lines

Except when the boards are pretty similar. Also, doesn't barebox have only one build for Tegra?

I haven't looked at Barebox much. IIRC it only supports Tegra20 and not later SoCs which could simplify things. Besides, I'm not arguing that it's impossible to make a unified binary, simply that I don't see any need to do so, except perhaps your compile-coverage suggestion.

Sure. I think it might help push the APIs along though. I recall creating a clock API for tegra20 some years ago. I think if we go to the next level (clock drivers for each SoC) the SoC differences start to look a lot less. It's mostly this core code that is the problem and much of it should move to drivers IMO.

Quoted 17 lines
Quoted 12 lines
Quoted 10 lines

As an aside, I've wondered whether U-Boot should be split into multiple parts; one HW-specific binary providing various drivers (e.g. via DM-related
APIs?) and the other containing just high-level user-interface code such as
the shell, high-level USB/... protocols, which would only call into those APIs. Still, I don't think we're anywhere close to that, and I'm not aware
that it's a goal of the project at the moment.

Quoted 3 lines

Well it gets built as one binary, but there's a pretty clear separation in the code, at least with driver model. What's the purpose of this?

Quoted 9 lines

It would allow the HW-agnostic portion to be compiled once (or once for a CPU ISA) and re-used with any of the HW-/board-specific "driver" blobs. It'd get use to "single binary" for the generic stuff, but without requiring the for HW-specific code. Perhaps the generic portion could even run on top of other driver stacks if they implemented the API it needed! However, this does ignore potential feature differences in the common binary, e.g. someone might want dfu/ums commands, but someone else might not need them and hence consider them bloat. Still, those configurations would be differentiated by feature more than HW, so it might still be useful.

Sounds cool. It would certainly tidy up the U-Boot API a lot, I suppose. You could have a micro-module approach where every little feature is its own loadable module. But really, what is the benefit?

Regards,
Simon

#125 lore raw

PATCH 38/60 ARM: tegra: remove tegra_get_chip()

Quoted 59 lines · Simon Glass

Hi Stephen,

Quoted 56 lines · Stephen Warren
Quoted 54 lines · Simon Glass

Hi Stephen,

Quoted 34 lines · Stephen Warren
Quoted 28 lines · Simon Glass

Hi Stephen,

Quoted 13 lines · Stephen Warren

From: Stephen Warren <[email protected]>

U-Boot is compiled for a single board, which in turn uses a specific SoC.
There's no need to make runtime decisions based on SoC ID. While there's
certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all runtime decisions should likely be based on DT anyway.

Quoted 8 lines
---
    arch/arm/mach-tegra/ap.c               | 106 ++++++++++-----------------------
    arch/arm/mach-tegra/cache.c            |  20 +++----
    arch/arm/mach-tegra/cpu.c              |  16 ++---
    arch/arm/mach-tegra/cpu.h              |   6 --
    arch/arm/mach-tegra/tegra20/warmboot.c |  20 ++-----
    5 files changed, 51 insertions(+), 117 deletions(-)
Quoted 1 line

What exactly is missing to prevent multi-arch support?

In a word: everything:-)

Quoted 13 lines

Pretty much all decisions in core architecture code, core Tegra code, drivers, and even board files are currently made at compile time. For example, consider drivers where the register layouts are different between different SoCs; not just new fields added, but existing fields moved to different offsets. Right now, we handle this by changing the register struct definition at compile time. To support multiple chips, we'd have to either
(a) link in n copies of the driver, one per register layout, or (b) rework the driver to use #defines and runtime calculations for register offsets, like the Linux kernel drivers do. Tegra USB is one example. The pinmux and clock drivers have a significantly different sets of pins/clocks/resets/... per SoC, and enums/tables describing those sets are currently configured at compile time. Some PMIC constants (e.g. vdd_cpu voltage) are configured at compile-time, and even differ per board.

I wonder how far we would get by converting clock, pinctrl, reset to driver model drivers?

Quoted 8 lines
Quoted 6 lines

Well, I expect we'll find out soon. The next SoC has radically different clock/reset mechanisms, so we'll need to switch to standardized APIs for clock/reset on Tegra to isolate drivers from those differences, and I imagine that conversion would also involve conversion to DM since any standard APIs probably assume use of DM. I haven't investigated this in detail yet though.

That sounds like a good move.

I'm not sure if you still object to this patch for now, or would be happy giving it an ack?

#126 lore raw

PATCH 38/60 ARM: tegra: remove tegra_get_chip()

Hi Stephen,

Quoted 90 lines · Stephen Warren
Quoted 89 lines · Simon Glass

Hi Stephen,

Quoted 83 lines · Stephen Warren
Quoted 71 lines · Simon Glass

Hi Stephen,

Quoted 56 lines · Stephen Warren
Quoted 34 lines · Simon Glass

Hi Stephen,

Quoted 16 lines · Stephen Warren

From: Stephen Warren <[email protected]>

U-Boot is compiled for a single board, which in turn uses a specific SoC.
There's no need to make runtime decisions based on SoC ID. While there's
certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all
runtime decisions should likely be based on DT anyway.

Quoted 8 lines
---
    arch/arm/mach-tegra/ap.c               | 106
++++++++++-----------------------
    arch/arm/mach-tegra/cache.c            |  20 +++----
    arch/arm/mach-tegra/cpu.c              |  16 ++---
    arch/arm/mach-tegra/cpu.h              |   6 --
    arch/arm/mach-tegra/tegra20/warmboot.c |  20 ++-----
    5 files changed, 51 insertions(+), 117 deletions(-)
Quoted 1 line

What exactly is missing to prevent multi-arch support?

In a word: everything:-)

Pretty much all decisions in core architecture code, core Tegra code, drivers, and even board files are currently made at compile time. For example, consider drivers where the register layouts are different between
different SoCs; not just new fields added, but existing fields moved to different offsets. Right now, we handle this by changing the register struct
definition at compile time. To support multiple chips, we'd have to either
(a) link in n copies of the driver, one per register layout, or (b) rework
the driver to use #defines and runtime calculations for register offsets,
like the Linux kernel drivers do. Tegra USB is one example. The pinmux

Quoted 8 lines

and
clock drivers have a significantly different sets of pins/clocks/resets/...
per SoC, and enums/tables describing those sets are currently configured at
compile time. Some PMIC constants (e.g. vdd_cpu voltage) are configured at
compile-time, and even differ per board.

Quoted 2 lines

I wonder how far we would get by converting clock, pinctrl, reset to driver model drivers?

Well, I expect we'll find out soon. The next SoC has radically different clock/reset mechanisms, so we'll need to switch to standardized APIs for clock/reset on Tegra to isolate drivers from those differences, and I imagine that conversion would also involve conversion to DM since any standard APIs probably assume use of DM. I haven't investigated this in detail yet though.

Quoted 5 lines
Quoted 1 line

That sounds like a good move.

I'm not sure if you still object to this patch for now, or would be happy giving it an ack?

Sorry, I still feel this is going in the wrong direction...CONFIG_TEGRA124 should mean that the code supports it, rather than the code exclusively supports it.

In your commit message you say:

"While there's
certainly an argument for making the code support different SoCs at run-time, the Tegra code is so far from that possible ideal that the existing runtime code is an anomaly. If this changes in the future, all runtime decisions should likely be based on DT anyway."

Or even build time.... That statement seems like saying that everything is so terrible that we might as well give up.

What's your plan to move code into drivers? I am happy to help move things over and get towards the goal rather than further away. But really that should happen first.

Also, the model that seems to be emerging is that SPL detects the platform and passes the correct DT to U-Boot proper.

Specifically I think the end state should be:
- Most SoC code is in drivers using driver model
- It is possible to build most of the tegra code without building each SoC (just by having a 'tegra' board which enables all drivers)
- If someone wanted to support multiple SoCs it would not be impossible to do so (even if mainline doesn't make it)
- New SoCs are supported mostly by adding new drivers (although there is always of course some core/start-up code)

Do you agree with that?

Regards,
Simon