Commit Graph

14053 Commits

Author SHA1 Message Date
Simon Glass
ce6d99a056 dm: sound: Create a uclass for audio codecs
An audio codec provides a way to convert digital data to sound and vice
versa. Add a simple uclass which just supports setting the parameters for
the codec.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
45863db5a9 dm: sound: Rename samsung_i2s_priv to i2s_uc_priv
This structure contains information that is likely needed by any i2s
driver so it seems useful to attach it to the (forthcoming) i2c uclass.
For now, just rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
2a04957241 dm: sound: Create an option to use driver model for sound
The U-Boot sound system provides basic support for beeping. At present it
does not use driver model, but it needs to be converted. Add an option to
enable driver model for sound. For now it is not connected to anything.
Future work will add drivers which use this option. It will then be
removed once everything is converted.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
51b06dc40b dm: sound: exynos: Correct codec bus addresses
For snow the codec is at address 0x11 on the i2c bus, in 7-bit format.
The device tree and code are in 8-bit format (i.e. shifted left one bit).
Fix both. Fix pit in a similar way.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
a1efd49ee2 dm: sound: Fix up header ordering
Tidy up the ordering of header files in the sounds files.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
9ca9f6d58b dm: sound: wm8994: Drop wm8994_i2c_init()
This function has only one line in it. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
04660d6424 dm: sound: max98095: Drop g_codec_info and g_max98095_info
These are only used in two functions so can be made local.

Also change the first argument of max98095_do_init() to suit.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
62ba831872 dm: sound: wm8994: Drop g_codec_info and g_wm8994_info
These are only used in two functions so can be made local.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
372922ca8f dm: sound: max98095: Drop global i2c-address variable
We can put this in the private structure and avoid a global.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
6ab0d25d55 dm: sound: wm8994: Drop global i2c-address variable
We can put this in the private structure and avoid a global.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
82a27d2c8c dm: sound: max98095: Split out interface setup code
With driver model we want to do a minimal probe when the device is probed
and then set up the codec interface later when a sound is actully played.

Split this setup code out into its own function to help with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
cfbe7623d6 dm: sound: wm899c: Split out interface setup code
With driver model we want to do a minimal probe when the device is probed
and then set up the codec interface later when a sound is actully played.

Split this setup code out into its own function to help with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
54e67e2739 dm: sound: wm8994: Create a new common init function
With driver model we cannot pass in the global struct, but instead want
to pass in the driver-private data. Split some of the code out of
wm8994_init() to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
a832a3e36f dm: sound: max98095: Pass private data to internal functions
At present the driver-private data is global. To allow this code to be
used with driver model, change it to pass the data down to each function.
Use the name 'priv' consistently throughout.

Also rename max98095_update_bits() to max98095_bic_or() which is more
descriptive and shorter, thus breaking fewer lines with the parameter
addition.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
107ab83e61 dm: sound: wm8994: Pass private data to internal functions
At present the driver-private data is global. To allow this code to be
used with driver model, change it to pass the data down to each function.
Use the name 'priv' consistently throughout.

Also rename wm8994_update_bits() to wm8994_bic_or() which is more
descriptive and shorter, thus breaking fewer lines with the parameter
addition.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
7153ad834f dm: sound: Drop codec_type
This field is not really used. It is always set to a known value. Drop it
to simplify the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
ccf0425e32 dm: sound: samsung: Rename i2stx_info to samsung_i2s_priv
This struct is only used by the Samsung I2C driver and should move into
that driver. For now, rename it so it is clear that is driver-private
info.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
d2eab333a7 dm: sound: Drop unused pre-device-tree code
CONFIG_OF_CONTROL is enabled for all boards that use sound, so remove the
dead code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Simon Glass
eb13350216 dm: sound: samsung: Make local function static
Several functions are not exported from this file. Make them static so
this is clear.

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-13 16:32:49 -07:00
Tom Rini
d117d8f19b Merge branch 'master' of git://git.denx.de/u-boot-i2c 2018-12-13 09:36:55 -05:00
Peng Fan
cdd7486616 firmware: psci: introduce SPL_ARM_PSCI_FW
Introduce a new macro SPL_ARM_PSCI_FW

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2018-12-12 12:14:25 -05:00
Sekhar Nori
d50d6817b5 spl: fix build failure with !CONFIG_SPL_PCI_SUPPORT
Building U-Boot with CONFIG_PCI and CONFIG_DM_PCI enabled, but
CONFIG_SPL_PCI_SUPPORT disabled, results in following linker
error:

lib/built-in.o: In function `fdtdec_get_pci_bar32':
lib/fdtdec.c:305: undefined reference to `dm_pci_read_bar32'
fdtdec.c:305:(.text.fdtdec_get_pci_bar32+0x24): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dm_pci_read_bar32'

This is because reference to dm_pci_read_bar32() remains in lib/fdtdec.c
while SPL build does not descend into drivers/pci directory in
drivers/Makefile if CONFIG_SPL_PCI_SUPPORT is not enabled.

Fix this by applying appropriate #define guards in lib/fdtdec.c.
It looks like ns16550.c has the same problem, so fixed that too.

To simplify this, CONFIG_SPL_PCI_SUPPORT is renamed to CONFIG_SPL_PCI
(enables use of CONFIG_IS_ENABLED() macro).

Suggested-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-12 12:14:23 -05:00
Tom Rini
91ff686562 blk: Rework guard around part_init call
The function part_init() will only be built when we have both
CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE set.  Protect the call to
this function with both of these tests now.

Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Cc: Mingkai Hu <mingkai.hu@nxp.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Marek Behún <marek.behun@nic.cz>
Cc: Vanessa Maegima <vanessa.maegima@nxp.com>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Adam Ford <aford173@gmail.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Tom Warren <twarren@nvidia.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-12 12:14:22 -05:00
Jean-Jacques Hiblot
22ecff594d i2c: tegra: Fix regression by implementing a dummy probe_chip() callback
Commit f32a8007ef ("dm: i2c: Make i2c_get_chip_for_busnum() fail if the
chip is not detected") introduced a regression for the NVIDIA Jetson TX2.

For some reason the xfer callback of the tegra i2c driver doesn't support
probing the I2C devices with a 0-length message.
Fixing the regression by providing a dummy implementation of probe_chip()
that does nothing.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2018-12-12 06:06:14 +01:00
Tom Rini
d94604d558 Add TFA boot flow for some Layerscape platforms
Add support for lx2160a SoC
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEorkTmaQ1QAtDiYw67UVZlNoLnbQFAlwOzFoACgkQ7UVZlNoL
 nbQUdQ//SRRBfjUe8RYTbojvTGQav0GTxnMkz4GFSrqu0nvGMW2YSlheOMqq72sg
 rK5mQqDvdkItCn+G8AZ5NV2ijkQ7NQWCfqL3EtApzTpv6qjfgv7xvopz8q4NZvzB
 Wp+4cFf9YQjNwhJ7kLvWHB7SBiz9AfMYRAj9cscH9xsGL3HxPj62WDfwyK/QXana
 KIxRKQ26/1AdOZy272yv70vlFj4IwForxV3ACimsWRuYcb8yre3pE0tD7XpMCSNv
 9GOfL7r4LS7U0+QnJoVeYLMhttRvOGJNUYtO2+ImO5NC3u9v8ehYEQ3FjGmM69CB
 vuPDQBDQc+Ap+Iu3k18PYSstp+mc9fbe9SQdlx6ARAecQqWTN4EOhf8s3m2bQq3S
 B58I0Zvowcdm8V2JKdXw94UqZX862U8PWH0BmcuX+4k+kRDwwU4XQY2nLp+Htz1w
 2q6vEdKGj7YUOaomx9fmKRL+9BFGoD+M9mTiHOwzqwxy6Pa9VkruSvMErM7p2l/z
 xI/Q+xPJhyk5TXgZRsz4Nat59WpifWruibKEd4PArQ446heHWmzLWjw/MWiFyd/H
 agCdpDZVJ8R7h1Krs+Ez8XjR1Qcg0gs+CdNBuvqxzOpMQGGonXA1nwi8YfHykhII
 urfoC8pew1yxiLGw7J2JSX808HV/09WCSEsrOOhE3T78rXTDlS4=
 =aT7d
 -----END PGP SIGNATURE-----

Merge tag 'fsl-qoriq-for-v2019.01-rc2' of git://git.denx.de/u-boot-fsl-qoriq

Add TFA boot flow for some Layerscape platforms
Add support for lx2160a SoC

[trini: Add a bunch of missing MAINTAINERS entries]
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-10 17:19:59 -05:00
Tom Rini
8bf3c2442b Improvements:
- init DRAM for RK322x in SPL
 - add FAN53555 PMIC/regulator driver
 - update MicroCrystal RV3029 driver to Kconfig and sync from Linux
 - add bootcount uclass and first DM-driver for bootcount
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJcDiw9AAoJECaAFcEOcohNEa8H/RBWLbVQjHPXf6EjchXgVcSs
 Gc+g2QmKZbN21XebfzBpCuZj62NROTWUcrPtor17yEBiMM1xPfe1vC7qtbkR6USj
 VTt1JHeyGx3XafkkUpeps382YPfuaNqtabjwZaXlmeE4/VLbXQPE7x4tC4fdWus4
 9K3OGQgRNFirn+RIZ7dQWtCby82PEC3cHkPc/n82cVHofcDsgKYK9mPpfcCn/gWF
 A4Fa9cx4pjeaMrBHKjcByCiFmwYBPc97Hqzz64oHOdQP0g3h04ko+2w5DdwdeHVV
 jKNcvkHESF4m1RGjrTbLEhy1f5UuOfcA1ise/cDX4pjXlBdwxHmvqT5vsE0MQzI=
 =5sHL
 -----END PGP SIGNATURE-----

Merge tag 'for-master-20181210' of git://git.denx.de/u-boot-rockchip

Improvements:
- init DRAM for RK322x in SPL
- add FAN53555 PMIC/regulator driver
- update MicroCrystal RV3029 driver to Kconfig and sync from Linux
- add bootcount uclass and first DM-driver for bootcount
2018-12-10 10:19:09 -05:00
Tom Rini
7ff485c68b Merge branch 'master' of git://git.denx.de/u-boot-i2c
- DM_I2C_COMPAT removal for all ti platforms from Jean-Jacques Hiblot
- Fix in i2c command help output from Chirstoph Muellner.
2018-12-10 07:16:33 -05:00
Tom Rini
48d299a799 Merge branch 'master' of git://git.denx.de/u-boot-usb
- DWC3 and UDC cleanup
2018-12-10 07:15:12 -05:00
Philipp Tomsich
dfb0a70a1a power: add FAN53555 family support
This adds a driver for the FAN53555 family of regulators and wraps it
in a PMIC implementation.

While these devices support a 'normal' and 'suspend' mode (controlled
via an external pin) to switch between two programmable voltages, this
incarnation of the driver assumes that the device is always operating
in 'normal' mode.

Only setting/reading the programmed voltage is supported at this time
and the following device functionality remains unsupported:
  - switching the selected voltage (via a GPIO)
  - disabling the voltage output via software-control
This matches the functionality of the Linux driver.

Tested on a RK3399-Q7 (with 'option 5' devices): setting voltages from
the U-Boot shell and verifying output voltages on the board.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2018-12-10 10:04:45 +01:00
Philipp Tomsich
482734aa66 bootcount: add a DM RTC backing store for bootcount
This implements a driver using a RTC-based backing store for the DM
bootcount implementation.  The node configuring this feature will be
compatible with 'u-boot,bootcount-rtc' and the underlying RTC device
shall be reference through the property 'rtc'. An offset into the RTC
device's register space can be provided through the 'offset' property.

Tested on a RK3399-Q7 on a Flamingo carrier board using the SRAM area
of the carrier board's RV3029 RTC.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-10 10:04:45 +01:00
Philipp Tomsich
ebb73de168 bootcount: add uclass for bootcount
The original bootcount methods do not provide an interface to DM and
rely on a static configuration for I2C devices (e.g. bus, chip-addr,
etc. are configured through defines statically).  On a modern system
that exposes multiple devices in a DTS-configurable way, this is less
than optimal and a interface to DM-based devices will be desirable.

This adds a simple driver that is DM-aware and configurable via DTS.
If ambiguous (i.e. multiple bootcount-devices are present) the
/chosen/u-boot,bootcount-device property can be used to select one
bootcount device.

Initially, this provides support for the following DM devices:
 * RTC devices

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2018-12-10 10:04:44 +01:00
Kever Yang
f338cca1d2 rockchip: rk322x: ram: enable DRAM init in SPL instead of TPL
Patch for rk322x TPL is not merged, and only SPL is available now,
enable the sdram driver in SPL first. We should update back to TPL
after TPL is enabled for rk322x.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-10 10:04:44 +01:00
Jean-Jacques Hiblot
c483f4cec0 drivers: core: nullify gd->dm_root after dm_uninit()
To reset the DM after a new dtb is loaded, we need to call dm_uninit()
and then dm_init(). This fails however because gd->dm_root is not nullified
by dm_uninit().
Fixing it by setting gd->dm_root in dm_uninit().

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2018-12-10 07:23:45 +01:00
Jean-Jacques Hiblot
85e51be9fb drivers: core: Add the option SPL_DM_DEVICE_REMOVE to the Kconfig
It is currently not possible to include the support to remove devices in
the SPL. This is however needed by platforms that re-select their dtb after
DM is initialized; they need to remove all the previously bound devices
before triggering a scan of the new DT.

Add a Kconfig option to be able to include the support for device removal
in the SPL.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

Seeries-changes:3
- update commit message
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2018-12-10 07:22:30 +01:00
Jean-Jacques Hiblot
fb1b7712ad power: make most tps drivers and the twl4030 driver compatible with DM_I2C
Those driver are not DM drivers per se (not using the PMIC/regulator
framework) and are using the legacy I2C API. Make them compatible with
the DM_I2C API.

This impacts the following drivers:
- palmas (used by am57xx/dra7xx evms)
- tps65218 (used by am43xx evms)
- tps65217 and tps65910 (used by am335x evms and am335x boneblack vboot)
- twl4030 (used by omap3_logicpd)
- tps65217 (used by brppt1)
- twl6030

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2018-12-10 06:17:30 +01:00
Jean-Jacques Hiblot
5f97ae6814 i2c: omap24xx_i2c: Use platdata to probe the device
This allows the driver to be used without OF_CONTROL.
AM335x support DM_SPL but does not use SPL_OF_CONTROL. Enabling DM_I2C in
SPL thus requires that the omap I2C can be passed platdata.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2018-12-10 06:11:18 +01:00
Vignesh R
bca09ce4b0 i2c: omap24xx_i2c: Move away from SoC specific headers for reg offset
Move away from SoC specific headers to handle different register layout.
Instead use driver data to get appropriate register layouts like in the
kernel. While at it, perform some mostly cosmetic alignment/cleanup in
the functions being updated.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2018-12-10 06:09:34 +01:00
Jean-Jacques Hiblot
3542ff29e4 dm: device: Allow using uclass_find_device_by_seq() without OF_CONTROL
If OF_CONTROL is not enabled and DM_SEQ_ALIAS is enabled, we must
assign an alias (requested sequence number) to devices that belongs to a
class with the DM_UC_FLAG_SEQ_ALIAS flag. Otherwise
uclass_find_device_by_seq() cannot be used to get/probe a device. In
particular i2c_get_chip_for_busnum() cannot be used.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2018-12-10 06:05:32 +01:00
Jean-Jacques Hiblot
f32a8007ef dm: i2c: Make i2c_get_chip_for_busnum() fail if the chip is not detected
i2c_get_chip_for_busnum() really should check the presence of the chip on
the bus. Most of the users of this function assume that this is done.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2018-12-10 06:03:45 +01:00
Chris Packham
cde578ff36 ARM: mvebu: restore license information in mv_ddr_plat.{c,h}
This was unintentionally removed when syncing with upstream.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2018-12-09 17:10:13 -05:00
Tom Rini
8cb8c0c6a8 Merge git://git.denx.de/u-boot-marvell
- Sync DDR training with Marvell code for Armada 38x by Chris
- Misc updates to Armada 38x Helios4 board by Aditya
2018-12-09 08:40:49 -05:00
Philipp Tomsich
a740ee913e lib: merge CRC16-CCITT into u-boot/crc.h
This merges the CRC16-CCITT headers into u-boot/crc.h to prepare for
rolling CRC16 into the hash infrastructure.  Given that CRC8, CRC32
and CRC32-C already have their prototypes in a single header file, it
seems a good idea to also include CRC16-CCITT in the same.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-12-08 20:18:32 -05:00
Chris Packham
ebb1a59325 ARM: mvebu: a38x: sync ddr training code with mv_ddr-armada-18.09.02
This syncs drivers/ddr/marvell/a38x/ with the mv_ddr-armada-18.09 branch
of https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git.
Specifically this syncs with commit 99d772547314 ("Bump mv_ddr to
release armada-18.09.2").

The complete log of changes is best obtained from the mv-ddr-marvell.git
repository but some relevant highlights are:

  ddr3: add missing txsdll parameter
  ddr3: fix tfaw timimg parameter
  ddr3: fix trrd timimg parameter
  merge ddr3 topology header file with mv_ddr_topology one
  mv_ddr: a38x: fix zero memory size scrubbing issue

The upstream code is incorporated omitting the portions not relevant to
Armada-38x and DDR3. After that a semi-automated step is used to drop
unused features with unifdef

    find drivers/ddr/marvell/a38x/ -name '*.[ch]' | \
        xargs unifdef -m -UMV_DDR -UMV_DDR_ATF -UCONFIG_DDR4 \
                 -UCONFIG_APN806 -UCONFIG_MC_STATIC \
                 -UCONFIG_MC_STATIC_PRINT -UCONFIG_PHY_STATIC \
                 -UCONFIG_64BIT -UCONFIG_A3700 -UA3900 -UA80X0 \
                 -UA70X0

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stefan Roese <sr@denx.de>
2018-12-08 16:19:40 +01:00
Tom Rini
c49aff3e66 Merge branch 'master' of git://git.denx.de/u-boot-sunxi
- Various axp209 fixes
- Fixes for OLinuXino-A20-Lime2 / OLinuXino-A20-Lime2-eMMC
2018-12-07 19:02:01 -05:00
Tom Rini
10d3e90f46 Two fixes for the Amlogic Pinctrl driver :
- bad usage of clrsetbits_le32
 - bad pin definition for AXG Family
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJcCkUAAAoJEHfc29rIyEnRqtAP/2BpLCNUqeZXzgaTueFbSp6z
 JYPL45POLunaZrlTHVCrYTymcqr+AuS1cPjEIZI49RgVepDs6EWR/NcLWexiFKZ8
 kdxSVP8FO6675sJ8KdYzGbgdBna5a2HPWZtYmX0OHGKgiPClL9HAkGrFWAwJtlHK
 2zAQ+zRPt4TTwEgkmKK2/38Jz7rgkIpeXWoSuu9UEGmfkMhNFLGOPbzzNxHJTL3n
 Ll7hLjLTBexgS6FQSHlNOj4XOnUubGTCchblCuMeVrEmUnvsgsXkzNMpRvfClzsZ
 YsFgRHikTZG56QoUKErGu1XeJweF1DPQsYuxRQf4YJBjAiGHw0ASNgMy1cFmSfUp
 rRCPDm4RHbSAvg/26iEU62FyFFLfrbtYuQJoxvp9iQbeamdXzFg/m8FyW4lNUeMU
 xO42XobtsmEahsSlxPB9akIJEWOLNLXFt/HHCqHJZYGRu5wDK5ZysTp2E2sHCYF8
 zttTi8WoPfiClmo8bLTIW/2SLylYILn48b9Gw6uZUq9B2uhsVeEro6Ya0d/fkFUd
 IbtqGmcG/ejsh6R4V1BEHr96KEcpgXAzzWTW0IPGZIyQ4VHq+bOhL/YPm5eX2WVW
 Wq/qMmhXuoJpZP/l/b3B4xRhQ5JWjWPtd8C2QBBTOX8uCSbmS0z+r6s0CTDzesD+
 ODiWDH021RxK7WiJV4kN
 =dvG1
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-20181207' of git://git.denx.de/u-boot-amlogic

Two fixes for the Amlogic Pinctrl driver :
- bad usage of clrsetbits_le32
- bad pin definition for AXG Family
2018-12-07 19:01:09 -05:00
Olliver Schinagl
ef52605ebe power: axp209: Limit inrush current for broken boards
Some boards feature a capacitance on LDO3's output that is too large,
causing inrush currents which as a result, shut down the AXP209. This
has been reported before, without knowing the actual cause.

A fix appeared to be done with
commit 0e6e34ac8d ("sunxi: Olimex A20 boards: Enable LDO3 and LDO4 regulators").

The description there is a bit misleading, the kernel does not hang
during AXP209 initialization, the PMIC shuts down, causing voltages to
drop and thus the whole system freezes.

While the AXP209 does have the ability to ramp up the voltage slowly, to
reduce these inrush currents, the voltage rate control (VRC) however is
not applicable when switching on the LDO3 output. Only when going from
an enabled lower voltage setting, to a higher voltage setting is the VRC
in effect.

To work around this problem, we set LDO3 to the lowest possible setting
of 0.7 V if it was not yet enabled, and then let the VRC (if enabled) do
its thing. It should be noted, that for some undocumented reason, there
is a short delay needed between setting the LDO3 voltage register and
enabling the power. One would expect that this delay ought to be just
after enabling the output power at 0.7 V, but this did not work.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-12-07 22:24:33 +05:30
Olliver Schinagl
61436d502b power: axp209: Add support for voltage rate control on LDO3
The AXP209 LDO3 regulator supports voltage rate control, or can set a
slew rate.

This allows for the power to gradually rise up to the desired voltage,
instead of spiking up as fast as possible. Reason to have this can be
to reduce the inrush currents for example.

There are 3 slopes to choose from, the default, 'none' is a voltage rise
of 0.0167 V/uS, a 1.6 mV/uS and a 0.8 mV/uS voltage rise.

In ideal world (where vendors follow the recommended design guidelines)
this setting should not be enabled by default. Unless of course AXP209
crashes instead of reporting overcurrent condition as it normally should
do in this case.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-12-07 22:24:33 +05:30
Olliver Schinagl
3f7d76a7ed power: axp209: Reduce magic values by adding defines for LDO[234]
The AXP209 has a few 'magisc-ish' values that are better served with
clear defines.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-12-07 22:24:33 +05:30
Olliver Schinagl
f5eebc7925 power: axp209: Define the chip version mask
Use a define for the chip version mask on the axp209.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-12-07 22:24:33 +05:30
Jean-Jacques Hiblot
d66e54ac80 dwc3-generic: Add support for the TI DWC3 glue
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-12-07 16:31:46 +01:00