summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohan Jonker <jbx6244@gmail.com>2023-03-13 01:30:46 +0100
committerKever Yang <kever.yang@rock-chips.com>2023-05-06 17:28:18 +0800
commit0fbb96964b8574ca8012b2022cd0e431977fd340 (patch)
treee09485fee0bd6e656e655a72c7efe7396a9d3218 /include
parentaecae81a35ddf24ae086a68f9c40836a1a174171 (diff)
downloadu-boot-0fbb96964b8574ca8012b2022cd0e431977fd340.tar.gz
u-boot-0fbb96964b8574ca8012b2022cd0e431977fd340.tar.bz2
u-boot-0fbb96964b8574ca8012b2022cd0e431977fd340.zip
core: remap: fix regmap_init_mem_plat() reg size handeling
The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU can expect 64-bit data from the device tree parser, so convert regmap_init_mem_plat() input to handel both. The syscon class driver also makes use of the regmap_init_mem_plat() function, but has no way of knowing the format of the device-specific platform data. In case of odd reg structures other then that the syscon class driver assumes the regmap must be filled in the individual syscon driver before pre-probe. Also fix the ARRAY_SIZE divider in the syscon class driver. Signed-off-by: Johan Jonker <jbx6244@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/regmap.h5
-rw-r--r--include/syscon.h13
2 files changed, 3 insertions, 15 deletions
diff --git a/include/regmap.h b/include/regmap.h
index e81a3602ae..22b043408a 100644
--- a/include/regmap.h
+++ b/include/regmap.h
@@ -378,17 +378,18 @@ int regmap_init_mem(ofnode node, struct regmap **mapp);
*
* @dev: Device that uses this map
* @reg: List of address, size pairs
+ * @size: Size of one reg array item
* @count: Number of pairs (e.g. 1 if the regmap has a single entry)
* @mapp: Returns allocated map
* Return: 0 if OK, -ve on error
*
* This creates a new regmap with a list of regions passed in, rather than
- * using the device tree. It only supports 32-bit machines.
+ * using the device tree.
*
* Use regmap_uninit() to free it.
*
*/
-int regmap_init_mem_plat(struct udevice *dev, fdt_val_t *reg, int count,
+int regmap_init_mem_plat(struct udevice *dev, void *reg, int size, int count,
struct regmap **mapp);
int regmap_init_mem_index(ofnode node, struct regmap **mapp, int index);
diff --git a/include/syscon.h b/include/syscon.h
index f5e6cc1a4b..7a5ee3fa26 100644
--- a/include/syscon.h
+++ b/include/syscon.h
@@ -25,19 +25,6 @@ struct syscon_ops {
#define syscon_get_ops(dev) ((struct syscon_ops *)(dev)->driver->ops)
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-/*
- * We don't support 64-bit machines. If they are so resource-contrained that
- * they need to use OF_PLATDATA, something is horribly wrong with the
- * education of our hardware engineers.
- *
- * Update: 64-bit is now supported and we have an education crisis.
- */
-struct syscon_base_plat {
- fdt_val_t reg[2];
-};
-#endif
-
/**
* syscon_get_regmap() - Get access to a register map
*