diff options
author | Simon Glass <sjg@chromium.org> | 2016-07-04 11:58:33 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-07-14 20:40:24 -0600 |
commit | 5ce4bb2709cea7bde2196ad5f3af11f8f3aa3375 (patch) | |
tree | 979c291f3f9d86c10875c1b5df2325fc5e1cd8a9 /arch | |
parent | 6afc4661e0a2daa655096702171c420518f8c2a8 (diff) | |
download | u-boot-imx-5ce4bb2709cea7bde2196ad5f3af11f8f3aa3375.zip u-boot-imx-5ce4bb2709cea7bde2196ad5f3af11f8f3aa3375.tar.gz u-boot-imx-5ce4bb2709cea7bde2196ad5f3af11f8f3aa3375.tar.bz2 |
rockchip: syscon: Update to work with of-platdata
The syscon devices all end up having diffent driver names with of-platdata,
since the driver name comes from the first string in the compatible list.
Add separate device declarations for each one, and add a bind method to set
up driver_data correctly.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-rockchip/rk3288/syscon_rk3288.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/rk3288/syscon_rk3288.c b/arch/arm/mach-rockchip/rk3288/syscon_rk3288.c index c9f7c4e..be4b2b0 100644 --- a/arch/arm/mach-rockchip/rk3288/syscon_rk3288.c +++ b/arch/arm/mach-rockchip/rk3288/syscon_rk3288.c @@ -23,3 +23,41 @@ U_BOOT_DRIVER(syscon_rk3288) = { .id = UCLASS_SYSCON, .of_match = rk3288_syscon_ids, }; + +#if CONFIG_IS_ENABLED(OF_PLATDATA) +static int rk3288_syscon_bind_of_platdata(struct udevice *dev) +{ + dev->driver_data = dev->driver->of_match->data; + debug("syscon: %s %d\n", dev->name, (uint)dev->driver_data); + + return 0; +} + +U_BOOT_DRIVER(rockchip_rk3288_noc) = { + .name = "rockchip_rk3288_noc", + .id = UCLASS_SYSCON, + .of_match = rk3288_syscon_ids, + .bind = rk3288_syscon_bind_of_platdata, +}; + +U_BOOT_DRIVER(rockchip_rk3288_grf) = { + .name = "rockchip_rk3288_grf", + .id = UCLASS_SYSCON, + .of_match = rk3288_syscon_ids + 1, + .bind = rk3288_syscon_bind_of_platdata, +}; + +U_BOOT_DRIVER(rockchip_rk3288_sgrf) = { + .name = "rockchip_rk3288_sgrf", + .id = UCLASS_SYSCON, + .of_match = rk3288_syscon_ids + 2, + .bind = rk3288_syscon_bind_of_platdata, +}; + +U_BOOT_DRIVER(rockchip_rk3288_pmu) = { + .name = "rockchip_rk3288_pmu", + .id = UCLASS_SYSCON, + .of_match = rk3288_syscon_ids + 3, + .bind = rk3288_syscon_bind_of_platdata, +}; +#endif |