This pull request contains ARM-based platform code changes for 6.4,

please pull the following:
 
 - Rob makes use of the of_address_to_resource() helper instead of open
   coding it in the Kona SMC code.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEm+Rq3+YGJdiR9yuFh9CWnEQHBwQFAmQ0mukACgkQh9CWnEQH
 BwSexA//QDUhdc4EvsJ4jZLrNEzHUhDhwoyShxIuefGjFJfMxcTs17pYCeHMGbAj
 vGlrvB3BcgxWzp6Tbk3Xp80KetV9R9bJh0/v3kZobzDB2h8xwZbH7Enefhmot65+
 FBT5FLp2KYrHW1ktxnDxcfnEU9mN+IOvhXALN3U2U0WqpRXakwQNGwjoNVQuiA6J
 AF8OOP5D3xzuR0HzxrOrVYdLWstwT+jnIA5CQrpQNehiEpxMgoyJcYowX1u4hMcP
 yc6/wxPJm2t0LLMJ+483rxv8KXeb6ldbsy3ZOpI89xj53RNVYy9hUcN4Fr+1HY8z
 Y/ofPYZrp9aswUFkvc7MDalXuvo/4AnzmpdPpxBLqo6Xj7C3uh4JBWHBwfYMVXQB
 ieXisTTzo0IbJFaYo3ox7uetJF9o3xx0mPUdZBnNLxVw50lAxll1ndJiG1iOCMeM
 +hQ/Y/SXe3lq5jBS3mcTlDt4IxVX3Efi3xiF3n2fQuCJe7jl2ZknXo2cOWVSZNCd
 YOM00W6IHEjjRZjW2+SlU/A+bhIL8wCOqKx/ysN64E8N+y/TYZ2jp/fHi4AqnPPE
 HyKtKvS48haFiKcxgEAjx/jhYcN34gmM5xIbXGI/dLiKX0rXuaYB1CRTc64PKwqB
 4n0ghLj7ZxDLRkWXFlbSSY1+9igIctbgiMONJUxAZeVkfvGb/P0=
 =xsFP
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmQ5QZ0ACgkQYKtH/8kJ
 UifY+hAAydcz/suYHlgRZk29kDi2fynR9s+EwkG1xjyxuFb+xg+m1DyK20FUrJR9
 krZ9eiFeuaR4Asgx4e2MxvZhhyTRtk6uVj++GCk5FVMN7AGeq7UQH7tYGWsfArDw
 mAuF7UAdF3Wvo5UZYVtp7nLEm8BEpqojiVyQDhSHK/Fkp32Lbz2s4NjyCE+W/3C2
 DHWgp2poqpB7B1MZl3F+IOimgq00cXZZJ1m4YYE9GXkG5yihTTjNY0lGK8shzUhg
 6SEU8uPOWQcbjzkfuJTOSMrW7DCbnlWAnw0iSn8X+RQLhw+y8xUDrtF8CKZVzSG4
 rL2prFAOtYQDv+fhYK/BfwAlKiqLghmrSl6RxycHuQpEkg24WO7TAGz4LXYcfKcD
 zZHotuRpHiWrtn++6e6Qwb0ZEUEHtMdk7BhdrF95spjo+STQr9xs1D/pnsa/9s+9
 niPqdwUl2aOdEfa2AgyrSVwGb0dVJH/tH0lVaZo1xzCxELWkoFMxNLfZCXGuXsx4
 i8yOvBv72h1ZQSLHpDzoyf4ZQIaU64G/lHXhdCUEyKHc4C6gQqGSgGD55YWFZZll
 oUD79n033o1y1KB0iDsBdx6zxmAbAIQmb/m5LZrA6PKrmqDGMZ0vu4wDvN5APfwc
 RKpxkBcNLiO74IT8CTAhBlsmu1CZu22mA4v8C+hfvnAGUPchVTk=
 =iU7z
 -----END PGP SIGNATURE-----

Merge tag 'arm-soc/for-6.4/soc' of https://github.com/Broadcom/stblinux into soc/arm

This pull request contains ARM-based platform code changes for 6.4,
please pull the following:

- Rob makes use of the of_address_to_resource() helper instead of open
  coding it in the Kona SMC code.

* tag 'arm-soc/for-6.4/soc' of https://github.com/Broadcom/stblinux:
  ARM: bcm: Use of_address_to_resource()

Link: https://lore.kernel.org/r/20230410232606.1917803-4-f.fainelli@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2023-04-14 14:05:48 +02:00
commit 3e54e7c8c4

View File

@ -31,34 +31,23 @@ static const struct of_device_id bcm_kona_smc_ids[] __initconst = {
int __init bcm_kona_smc_init(void)
{
struct device_node *node;
const __be32 *prop_val;
u64 prop_size = 0;
unsigned long buffer_size;
u32 buffer_phys;
struct resource res;
int ret;
/* Read buffer addr and size from the device tree node */
node = of_find_matching_node(NULL, bcm_kona_smc_ids);
if (!node)
return -ENODEV;
prop_val = of_get_address(node, 0, &prop_size, NULL);
ret = of_address_to_resource(node, 0, &res);
of_node_put(node);
if (!prop_val)
if (ret)
return -EINVAL;
/* We assume space for four 32-bit arguments */
if (prop_size < 4 * sizeof(u32) || prop_size > (u64)ULONG_MAX)
return -EINVAL;
buffer_size = (unsigned long)prop_size;
buffer_phys = be32_to_cpup(prop_val);
if (!buffer_phys)
return -EINVAL;
bcm_smc_buffer = ioremap(buffer_phys, buffer_size);
bcm_smc_buffer = ioremap(res.start, resource_size(&res));
if (!bcm_smc_buffer)
return -ENOMEM;
bcm_smc_buffer_phys = buffer_phys;
bcm_smc_buffer_phys = res.start;
pr_info("Kona Secure API initialized\n");