Reset controller changes for v4.17

This enables level resets on Meson8b SoCs. Level resets have been
 previously implemented for the newer Meson GX SoCs, so this removes
 the distinction between the two families in the meson-reset driver.
 
 Also enables the ASPEED LPC reset controller on ASPEED AST2400 and
 AST2500 SoCs, by adding compatibles to the simple-reset driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEBsBxhV1FaKwXuCOBUMKIHHCeYOsFAlqOqbQXHHAuemFiZWxA
 cGVuZ3V0cm9uaXguZGUACgkQUMKIHHCeYOsIog//XbKMgk6W349Ekl/S/d1tAiwE
 LbvatmmX30U3u+7b+C0u3opVGducC2Bo+IvUujie0J6zyKrbM/K3RTxS0Lunnoeg
 iRNzcETQkKUVX4drByYyMio+poMKZhD6cXEEZT0ukCe9EfkgGQ212dBv0EwI34Y9
 zL7eemQeR/e/a2W+WaIfgHDHZmicrM1YTiEHhji+ba9VhsllWl6cUYZEN1tRh5Sv
 b8yBBGkY5ccIW6bHGZnf3tERJ0onIfdjo1cXBFOMF8GYuv7gE3ZWSVx9+wp80Jc0
 ds5Lj6CyBUIU7P8Loq8q/bm1WNQlNyX2J7dMxsqesJP0fwxNUznLnzUos4CM35U6
 WZr0rdyXVsThIj/Erw6UFdFcHHcnpOWdjrMY8weIqxCBo6asaEEGE25XVRfxmf5Z
 mHBaFF+vLnFbGUpwcaWvcTlIRS3ydz1Ip+zCEqfuwsywpqJsXBerZb0owE7RuGXu
 gp4A9ar4hVdYllhcjwwjr9mbUuCeYH++yZIzhqsBBd+jgor0hcnPI0HteRYZXHOJ
 o4Il2UmtwZPHVkGtCXM1J7gY+/KyYmaj5roVSeJFLX5V1Uw0Cx5UVyjCAxBEfKhn
 V5aQS5qrlbLdR3t2E9OazNu8LbM2xeP3p35sgJxuvjtT5nQfhZm5nTlH8VyGvq4t
 46WvPYPVqF0tGMQSreU=
 =Ghzu
 -----END PGP SIGNATURE-----

Merge tag 'reset-for-4.17' of git://git.pengutronix.de/git/pza/linux into next/drivers

Pull "Reset controller changes for v4.17" from Philipp Zabel:

This enables level resets on Meson8b SoCs. Level resets have been
previously implemented for the newer Meson GX SoCs, so this removes
the distinction between the two families in the meson-reset driver.

Also enables the ASPEED LPC reset controller on ASPEED AST2400 and
AST2500 SoCs, by adding compatibles to the simple-reset driver.

* tag 'reset-for-4.17' of git://git.pengutronix.de/git/pza/linux:
  reset: simple: Enable for ASPEED systems
  dt-bindings: aspeed-lpc: Add reset controller
  reset: meson: enable level reset support on Meson8b
This commit is contained in:
Arnd Bergmann 2018-03-06 18:00:50 +01:00
commit e107f4bb65
4 changed files with 35 additions and 20 deletions

View File

@ -135,3 +135,24 @@ lhc: lhc@20 {
compatible = "aspeed,ast2500-lhc";
reg = <0x20 0x24 0x48 0x8>;
};
LPC reset control
-----------------
The UARTs present in the ASPEED SoC can have their resets tied to the reset
state of the LPC bus. Some systems may chose to modify this configuration.
Required properties:
- compatible: "aspeed,ast2500-lpc-reset" or
"aspeed,ast2400-lpc-reset"
- reg: offset and length of the IP in the LHC memory region
- #reset-controller indicates the number of reset cells expected
Example:
lpc_reset: reset-controller@18 {
compatible = "aspeed,ast2500-lpc-reset";
reg = <0x18 0x4>;
#reset-cells = <1>;
};

View File

@ -83,14 +83,18 @@ config RESET_PISTACHIO
config RESET_SIMPLE
bool "Simple Reset Controller Driver" if COMPILE_TEST
default ARCH_SOCFPGA || ARCH_STM32 || ARCH_STRATIX10 || ARCH_SUNXI || ARCH_ZX
default ARCH_SOCFPGA || ARCH_STM32 || ARCH_STRATIX10 || ARCH_SUNXI || ARCH_ZX || ARCH_ASPEED
help
This enables a simple reset controller driver for reset lines that
that can be asserted and deasserted by toggling bits in a contiguous,
exclusive register space.
Currently this driver supports Altera SoCFPGAs, the RCC reset
controller in STM32 MCUs, Allwinner SoCs, and ZTE's zx2967 family.
Currently this driver supports:
- Altera SoCFPGAs
- ASPEED BMC SoCs
- RCC reset controller in STM32 MCUs
- Allwinner SoCs
- ZTE's zx2967 family
config RESET_SUNXI
bool "Allwinner SoCs Reset Driver" if COMPILE_TEST && !ARCH_SUNXI

View File

@ -124,29 +124,21 @@ static int meson_reset_deassert(struct reset_controller_dev *rcdev,
return meson_reset_level(rcdev, id, false);
}
static const struct reset_control_ops meson_reset_meson8_ops = {
.reset = meson_reset_reset,
};
static const struct reset_control_ops meson_reset_gx_ops = {
static const struct reset_control_ops meson_reset_ops = {
.reset = meson_reset_reset,
.assert = meson_reset_assert,
.deassert = meson_reset_deassert,
};
static const struct of_device_id meson_reset_dt_ids[] = {
{ .compatible = "amlogic,meson8b-reset",
.data = &meson_reset_meson8_ops, },
{ .compatible = "amlogic,meson-gxbb-reset",
.data = &meson_reset_gx_ops, },
{ .compatible = "amlogic,meson-axg-reset",
.data = &meson_reset_gx_ops, },
{ .compatible = "amlogic,meson8b-reset" },
{ .compatible = "amlogic,meson-gxbb-reset" },
{ .compatible = "amlogic,meson-axg-reset" },
{ /* sentinel */ },
};
static int meson_reset_probe(struct platform_device *pdev)
{
const struct reset_control_ops *ops;
struct meson_reset *data;
struct resource *res;
@ -154,10 +146,6 @@ static int meson_reset_probe(struct platform_device *pdev)
if (!data)
return -ENOMEM;
ops = of_device_get_match_data(&pdev->dev);
if (!ops)
return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
data->reg_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(data->reg_base))
@ -169,7 +157,7 @@ static int meson_reset_probe(struct platform_device *pdev)
data->rcdev.owner = THIS_MODULE;
data->rcdev.nr_resets = REG_COUNT * BITS_PER_REG;
data->rcdev.ops = ops;
data->rcdev.ops = &meson_reset_ops;
data->rcdev.of_node = pdev->dev.of_node;
return devm_reset_controller_register(&pdev->dev, &data->rcdev);

View File

@ -125,6 +125,8 @@ static const struct of_device_id reset_simple_dt_ids[] = {
.data = &reset_simple_active_low },
{ .compatible = "zte,zx296718-reset",
.data = &reset_simple_active_low },
{ .compatible = "aspeed,ast2400-lpc-reset" },
{ .compatible = "aspeed,ast2500-lpc-reset" },
{ /* sentinel */ },
};