All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 51/55] rockchip: syscon: Update to work with of-platdata
Date: Sun, 12 Jun 2016 23:33:32 -0600	[thread overview]
Message-ID: <1465796016-18375-52-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1465796016-18375-1-git-send-email-sjg@chromium.org>

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>
---

Changes in v2: None

 arch/arm/mach-rockchip/rk3288/syscon_rk3288.c | 38 +++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

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
-- 
2.8.0.rc3.226.g39d4020

  parent reply	other threads:[~2016-06-13  5:33 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  5:32 [U-Boot] [PATCH v2 00/55] RFC: dm: rockchip: Add support for compiled-in platform data Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 01/55] sandbox: Don't print a warning for CONFIG_I2C_COMPAT Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 02/55] README: Remove CONFIG_SYS_MALLOC_F_LEN comment Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 03/55] spl: Drop include of i2c.h Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 04/55] Makefile: Allow the SPL final link rule to be overridden Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 05/55] sandbox: Allow chaining from SPL to U-Boot proper Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 06/55] sandbox: Support building an SPL image Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 07/55] sandbox: Correct header file order in cpu.c Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 08/55] sandbox: Add some missing headers " Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 09/55] sandbox: Don't use PCI in SPL Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 10/55] sandbox: Don't include the main loop " Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 11/55] sandbox: Add basic SPL implementation Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 12/55] sandbox: Don't use IDE and iotrace in SPL Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 13/55] sandbox: serial: Don't sync video " Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 14/55] sandbox: Add a new sandbox_spl board Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 15/55] sandbox: Add a test device that uses of-platdata Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 16/55] dm: spl: Don't set up device tree with of-platdata Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 17/55] dm: Makefile: Build of-platdata before SPL Simon Glass
2016-06-13  5:32 ` [U-Boot] [PATCH v2 18/55] dm: core: Don't use device tree with of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 19/55] dm: regmap: Add a dummy implementation for of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 20/55] dm: syscon: Add support " Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 21/55] dm: sandbox: Add a simple driver to test of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 22/55] dm: Add a header that provides access to the of-platdata structs Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 23/55] dm: clk: Add support for of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 24/55] dm: serial: " Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 25/55] dm: Don't include fdtdec functions when of-platdata is enabled Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 26/55] dm: Add an option to enable the of-platdata feature Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 27/55] dm: Add a README for of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 28/55] dm: Add a library to provide simple device-tree access Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 29/55] dm: Add a tool to generate C code from a device tree Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 30/55] dm: Makefile: Build of-platdata files when the feature is enabled Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 31/55] dm: Add a more efficient libfdt library Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 32/55] Only build the libfdt python module if 'swig' is available Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 33/55] tiny-printf: Support assert() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 34/55] dm: spl: Bind in all devices in SPL with of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 35/55] dm: core: Rename DM_NAME_ALLOCED to DM_FLAG_NAME_ALLOCED Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 36/55] dtoc: Ignore the u-boot, dm-pre-reloc property Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 37/55] dm: Don't attach the device tree to SPL with of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 38/55] dm: core: Expand platdata for of-platdata devices Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 39/55] dm: core: Move regmap allocation into a separate function Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 40/55] dm: core: Add an implementation of regmap_init_mem_platdata() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 41/55] dm: serial: ns16550: Update to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 42/55] rockchip: serial: Add an of-platdata driver for rockchip Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 43/55] rockchip: Update the sdram-channel property to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 44/55] rockchip: mmc: Move all DT decoding to ofdata_to_platdata() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 45/55] rockchip: mmc: Update the driver to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 46/55] rockchip: clk: Move all DT decoding to ofdata_to_platdata() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 47/55] rockchip: clk: Update the rk3288 driver to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 48/55] rockchip: pinctrl: " Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 49/55] rockchip: Move the MMC setup check earlier Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 50/55] rockchip: Don't use spl_boot_device() with of-platdata Simon Glass
2016-06-13  5:33 ` Simon Glass [this message]
2016-06-13  5:33 ` [U-Boot] [PATCH v2 52/55] rockchip: sdram: Move all DT decoding to ofdata_to_platdata() Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 53/55] rockchip: sdram: Update the driver to support of-platdata Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 54/55] rockchip: Use of-platdata for firefly-rk3288 Simon Glass
2016-06-13  5:33 ` [U-Boot] [PATCH v2 55/55] dm: Update the of-platdata README for the new features Simon Glass
2016-06-23 20:04   ` Tom Rini
2016-06-23 20:36     ` Simon Glass
2016-06-23 22:55       ` Tom Rini
2016-06-26  3:00         ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465796016-18375-52-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.