aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-11-14 15:47:44 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-11-14 16:07:26 +1100
commit306639e92058678aab28b620f9e256cd56da4291 (patch)
tree2c754a63df844d3403a4026604ac2dd7a426b01c /platforms
parentd2a695ddb362b6f93e3fc4f8a8b509028c72825b (diff)
downloadskiboot-306639e92058678aab28b620f9e256cd56da4291.zip
skiboot-306639e92058678aab28b620f9e256cd56da4291.tar.gz
skiboot-306639e92058678aab28b620f9e256cd56da4291.tar.bz2
i2c: Update DT bindings and minor changes
The i2c bus frequency is now per port and we use more standard properties this and the clock frequency of the master cell itself. Also use "ibm,opal-i2c" as a compatible match to indicate that the DT node is compatible with the OPAL APIs, whether it's a P8 i2c bus or something else (we will eventually expose the centaur i2c's too for example). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/astbmc/common.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c
index e2d8629..250459a 100644
--- a/platforms/astbmc/common.c
+++ b/platforms/astbmc/common.c
@@ -162,8 +162,8 @@ static struct dt_node *dt_create_i2c_master(struct dt_node *n, uint32_t eng_id)
"ibm,power8-i2cm");
dt_add_property_cells(i2cm, "reg", 0xa0000 + eng_id * 0x20,
0x20);
- dt_add_property_cells(i2cm, "bus-speed-khz", 400);
- dt_add_property_cells(i2cm, "local-bus-freq-mhz", 50);
+ dt_add_property_cells(i2cm, "clock-frequency", 50000000);
+ dt_add_property_cells(i2cm, "chip-engine#", eng_id);
dt_add_property_cells(i2cm, "#address-cells", 1);
dt_add_property_cells(i2cm, "#size-cells", 0);
@@ -179,9 +179,11 @@ static struct dt_node *dt_create_i2c_bus(struct dt_node *i2cm, const char *port_
if (!port)
return NULL;
- dt_add_property_string(port, "compatible", "ibm,power8-i2c-port");
- dt_add_property_string(port, "port-name", port_name);
+ dt_add_property_strings(port, "compatible",
+ "ibm,power8-i2c-port", "ibm,opal-i2c");
+ dt_add_property_string(port, "ibm,port-name", port_name);
dt_add_property_cells(port, "reg", port_id);
+ dt_add_property_cells(port, "bus-frequency", 400000);
dt_add_property_cells(port, "#address-cells", 1);
dt_add_property_cells(port, "#size-cells", 0);
@@ -225,10 +227,10 @@ static void astbmc_fixup_dt_i2cm(void)
master = dt_create_i2c_master(c->devnode, 1);
assert(master);
- sprintf(name,"p8_%08x_e%dp%d\n", c->id, 1, 0);
+ sprintf(name,"p8_%08x_e%dp%d", c->id, 1, 0);
bus = dt_create_i2c_bus(master, name, 0);
assert(bus);
- sprintf(name,"p8_%08x_e%dp%d\n", c->id, 1, 2);
+ sprintf(name,"p8_%08x_e%dp%d", c->id, 1, 2);
bus = dt_create_i2c_bus(master, name, 2);
assert(bus);
dt_create_i2c_device(bus, 0x50, "eeprom", "atmel,24c64", "system-vpd");