SoC changes for omaps for v6.6

SoC changes to include the correct devicetree headers, and an update to
 make use of_range_to_resource(). There is also a non-urgent fix for
 pwrdm_read_prev_pwrst() array-bounds warning.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAmTUqHkRHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXNvSQ/+LvcFPfVoVNlZgEctfx8Hxuj+OQg09git
 yft+hr6mjJGMoeXByBZnQg48UsqSCLKj6UCWm54AojUf/TNuVpbAHXfpg9haeEBx
 1cJPmCwHyq/P4T2RdY/h9D4Z9zZ4IG9Hkvqa8FV5h3MwkADF0/zqFSQCeSbaaCm3
 6T+tNtpCSVR8QfCc3pNO/q4VQa/pKpgUi2VH+345PVOT++5ErhHvG4N/FzE4FoKy
 mvbFa0NL5lm2WZrWJQU9kty93wouVuS1lm/6yMe9i3bmGgson5JI60ohRucndU2h
 yu/ohPQArkBNP16jUNMONYx58nwOoluR11cz8ddXqIE9EYh7VUKvG9xXqrG2xAHE
 gkG7RQYWy517AVVgSpXjR1/B6xXzcVojueP3E6jJv0Yu2NS8g+lihBPG6xRcRAGS
 lvQDShKadkThRyI9PTTYIMHcQjGkwryCPAgvnzTCg/WQeMAyl26n8bl2YEPRwym1
 qukrmmnwLUkm0CwNlqRof6Rmw9bgWzIXgRWa0Ue6EWUTTa2U8fFxZFNFfICuutuT
 D+rjg8zTIABRdUDV+Zi7zwczWRQjB00CP3x0kVxHEdKI1fUk2GPh78Swu20Zv1yi
 jqIHcQgJ/jw+iEnwNpRVEvRXUClDIGyTPIW0xyAQGqvwAMifII0JQ3Bk4zsZ39S+
 MeL9/zuKfOo=
 =TCav
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmTXQ/EACgkQYKtH/8kJ
 Uicvfw//f+elQUm0asgZcKCPb3VIIlh9SwNkShtEIbZSUQkvxhqyCurGNb5pD8N+
 0CqngBnnGik7It0BL3PPvumzk9GGMMKWR+IcQDbtYCBsssQ7OV23YIsjbF1QyJYa
 AqYq83Lbej3VyeAA8Z78dJDWWBkqcswd69zl7A2UW+r8OiHFbRs+Fcb+dRB+35yb
 bz2D3mgfMjg8XynLf8vBkz2fpATOQu66EaD2Szn64I2ul0uVgtlUOGuV8CfsrV90
 RLBZUIxBqyB1sg/YkhPSEQI6IMSXf9jAehYsBOb/zioiOpVsVWSkdd0sVrn98bjY
 HARGPaM2dbxsY6MNOIJ2W3j0FzguWBgMLcBL0UrYwZyw8jSSG5YUxQCYTD350gGE
 CH8CaRAzJr7D/At9CwrtnHDfHDtcsKrHcGMyHFx6eZ50w3SyC3jjkou0d4K8zhn4
 zBTUbIhBcT1tmcBc2MmdueziqxB7N5+tgBrgW8yHobppqs7+bBlYCf8wnSKTZDz1
 deWnStj434siQUktMn7Q/6bKfmvYmuiQsxwIdtj5QMPe7xD1mIinXmv5TWZnDAYi
 XsjJPRn8cGiYvLBaXVKp1dx6nehS/9Q9IviO2UMHpvzQssxn9QYJwhR9zhUEWN7z
 qTVzb3GnTU8mHihpQSvJH0haX2Cmv/yWpQJn9euwae1VHPZ2OJI=
 =TEN6
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v6.6/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/arm

SoC changes for omaps for v6.6

SoC changes to include the correct devicetree headers, and an update to
make use of_range_to_resource(). There is also a non-urgent fix for
pwrdm_read_prev_pwrst() array-bounds warning.

* tag 'omap-for-v6.6/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: omap2: Explicitly include correct DT includes
  ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch()
  ARM: omap2: Use of_range_to_resource() for "ranges" parsing

Link: https://lore.kernel.org/r/pull-1691658952-110529@atomide.com-4
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2023-08-12 10:33:53 +02:00
commit c0c3bf7424
4 changed files with 9 additions and 44 deletions

View File

@ -9,11 +9,10 @@
* to support the OMAP2+ device tree boards with an unique board file.
*/
#include <linux/io.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/irqdomain.h>
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/mod_devicetable.h>
#include <asm/setup.h>
#include <asm/mach/arch.h>

View File

@ -12,10 +12,9 @@
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/irqchip.h>
#include <linux/platform_device.h>
#include <linux/memblock.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/export.h>
#include <linux/irqchip/arm-gic.h>
#include <linux/of_address.h>

View File

@ -2194,23 +2194,8 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
struct resource *res)
{
struct property *prop;
const __be32 *ranges;
const char *name;
u32 nr_addr, nr_size;
u64 base, size;
int len, error;
if (!res)
return -EINVAL;
ranges = of_get_property(np, "ranges", &len);
if (!ranges)
return -ENOENT;
len /= sizeof(*ranges);
if (len < 3)
return -EINVAL;
int err;
of_property_for_each_string(np, "compatible", prop, name)
if (!strncmp("ti,sysc-", name, 8))
@ -2219,26 +2204,12 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
if (!name)
return -ENOENT;
error = of_property_read_u32(np, "#address-cells", &nr_addr);
if (error)
return -ENOENT;
err = of_range_to_resource(np, 0, res);
if (err)
return err;
error = of_property_read_u32(np, "#size-cells", &nr_size);
if (error)
return -ENOENT;
if (nr_addr != 1 || nr_size != 1) {
pr_err("%s: invalid range for %s->%pOFn\n", __func__,
oh->name, np);
return -EINVAL;
}
ranges++;
base = of_translate_address(np, ranges++);
size = be32_to_cpup(ranges);
pr_debug("omap_hwmod: %s %pOFn at 0x%llx size 0x%llx\n",
oh->name, np, base, size);
pr_debug("omap_hwmod: %s %pOFn at %pR\n",
oh->name, np, &res);
if (oh && oh->mpu_rt_idx) {
omap_hwmod_fix_mpu_rt_idx(oh, np, res);
@ -2246,10 +2217,6 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
return 0;
}
res->start = base;
res->end = base + size - 1;
res->flags = IORESOURCE_MEM;
return 0;
}

View File

@ -174,7 +174,7 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
break;
case PWRDM_STATE_PREV:
prev = pwrdm_read_prev_pwrst(pwrdm);
if (pwrdm->state != prev)
if (prev >= 0 && pwrdm->state != prev)
pwrdm->state_counter[prev]++;
if (prev == PWRDM_POWER_RET)
_update_logic_membank_counters(pwrdm);