From patchwork Fri Feb 27 09:11:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 444214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D48801400DD for ; Fri, 27 Feb 2015 20:11:36 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id BAF391A00B6 for ; Fri, 27 Feb 2015 20:11:36 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 8FA1D1A0079 for ; Fri, 27 Feb 2015 20:11:12 +1100 (AEDT) Received: by ozlabs.org (Postfix, from userid 1023) id 69102140129; Fri, 27 Feb 2015 20:11:12 +1100 (AEDT) MIME-Version: 1.0 Message-Id: <1425028266.817479.972705074892.3.gpush@pablo> In-Reply-To: <1425028266.816963.907799920643.0.gpush@pablo> To: skiboot@lists.ozlabs.org From: Jeremy Kerr Date: Fri, 27 Feb 2015 17:11:06 +0800 Subject: [Skiboot] [PATCH 03/13] plat/astbmc: Remove i2c DT fixups X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Benjamin Herrenschmidt HostBoot now creates the necessary nodes Signed-off-by: Benjamin Herrenschmidt --- platforms/astbmc/common.c | 91 -------------------------------------- 1 file changed, 91 deletions(-) diff --git a/platforms/astbmc/common.c b/platforms/astbmc/common.c index 47c1764..a9878bf 100644 --- a/platforms/astbmc/common.c +++ b/platforms/astbmc/common.c @@ -210,94 +210,6 @@ static void astbmc_fixup_dt_uart(struct dt_node *lpc) dt_add_property_cells(uart, "ibm,irq-chip-id", dt_get_chip_id(lpc)); } -static struct dt_node *dt_create_i2c_master(struct dt_node *n, uint32_t eng_id) -{ - struct dt_node *i2cm; - - /* Each master registers set is of length 0x20 */ - i2cm = dt_new_addr(n, "i2cm", 0xa0000 + eng_id * 0x20); - if (!i2cm) - return NULL; - - dt_add_property_string(i2cm, "compatible", - "ibm,power8-i2cm"); - dt_add_property_cells(i2cm, "reg", 0xa0000 + eng_id * 0x20, - 0x20); - 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); - - return i2cm; -} - -static struct dt_node *dt_create_i2c_bus(struct dt_node *i2cm, const char *port_name, - uint32_t port_id) -{ - static struct dt_node *port; - - port = dt_new_addr(i2cm, "i2c-bus", port_id); - if (!port) - return NULL; - - 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); - - return port; -} - -static struct dt_node *dt_create_i2c_device(struct dt_node *bus, uint8_t addr, - const char *name, const char *compat, - const char *label) -{ - struct dt_node *dev; - - dev = dt_new_addr(bus, name, addr); - if (!dev) - return NULL; - - dt_add_property_string(dev, "compatible", compat); - dt_add_property_string(dev, "label", label); - dt_add_property_cells(dev, "reg", addr); - dt_add_property_string(dev, "status", "ok"); - - return dev; -} - -static void astbmc_fixup_dt_i2cm(void) -{ - struct proc_chip *c; - struct dt_node *master, *bus; - char name[32]; - - /* - * Look if any i2c is in the device-tree, in which - * case we assume HB did the job - */ - if (dt_find_compatible_node(dt_root, NULL, "ibm,power8-i2cm")) - return; - - /* Create nodes for i2cm1 of chip 0 */ - c = get_chip(0); - assert(c); - - master = dt_create_i2c_master(c->devnode, 1); - assert(master); - snprintf(name, sizeof(name), "p8_%08x_e%dp%d", c->id, 1, 0); - bus = dt_create_i2c_bus(master, name, 0); - assert(bus); - snprintf(name, sizeof(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,24c256", "system-vpd"); - assert(bus); -} - static void astbmc_fixup_dt(void) { struct dt_node *n, *primary_lpc = NULL; @@ -319,9 +231,6 @@ static void astbmc_fixup_dt(void) /* BT is not in HB either */ astbmc_fixup_dt_bt(primary_lpc); - /* Add i2c masters if needed */ - astbmc_fixup_dt_i2cm(); - /* The pel logging code needs a system-id property to work so make sure we have one. */ astbmc_fixup_dt_system_id();