From patchwork Wed Aug 24 10:17:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Cousson X-Patchwork-Id: 1091852 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7OAJKON011170 for ; Wed, 24 Aug 2011 10:19:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756735Ab1HXKTT (ORCPT ); Wed, 24 Aug 2011 06:19:19 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:58855 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755968Ab1HXKTT (ORCPT ); Wed, 24 Aug 2011 06:19:19 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p7OAJ6Vr009739 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Aug 2011 05:19:06 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep33.itg.ti.com (8.13.7/8.13.8) with ESMTP id p7OAJ5g3007031; Wed, 24 Aug 2011 05:19:05 -0500 (CDT) Received: from DFLE70.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7OAJ5q7025492; Wed, 24 Aug 2011 05:19:05 -0500 (CDT) Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle70.ent.ti.com (128.247.5.40) with Microsoft SMTP Server id 14.1.323.3; Wed, 24 Aug 2011 05:19:06 -0500 Received: from localhost.localdomain (lncpu04.tif.ti.com [137.167.102.15]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7OAI7NJ021410; Wed, 24 Aug 2011 05:19:04 -0500 From: Benoit Cousson To: CC: , , , , , Benoit Cousson , Tony Lindgren Subject: [RFC PATCH 6/7] OMAP4: board-dt: Add generic board with DT support Date: Wed, 24 Aug 2011 12:17:19 +0200 Message-ID: <1314181040-22807-7-git-send-email-b-cousson@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1314181040-22807-1-git-send-email-b-cousson@ti.com> References: <1314181040-22807-1-git-send-email-b-cousson@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 24 Aug 2011 10:19:21 +0000 (UTC) Create an OMAP4 generic board to start the DT migration. This file is doing the minimal initialization needed to boot properly on a RAMDISK filesystem. As soon as the OMAP4 specifics will be removed, that board will be converted to an even more generic board-dt.c that will support every OMAP 2+ platform. Signed-off-by: Benoit Cousson Cc: Tony Lindgren --- arch/arm/mach-omap2/Kconfig | 9 +++ arch/arm/mach-omap2/Makefile | 1 + arch/arm/mach-omap2/board-omap4-dt.c | 110 ++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/board-omap4-dt.c diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 57b66d5..5d501d2 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -326,6 +326,15 @@ config MACH_OMAP4_PANDA select OMAP_PACKAGE_CBS select REGULATOR_FIXED_VOLTAGE +config MACH_OMAP4_DT + bool "Generic OMAP4 board (FDT support)" + default y + depends on ARCH_OMAP4 + select OMAP_PACKAGE_CBL + select OMAP_PACKAGE_CBS + select REGULATOR_FIXED_VOLTAGE + select USE_OF + config OMAP3_EMU bool "OMAP3 debugging peripherals" depends on ARCH_OMAP3 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index b1501bd..79e42a1 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -223,6 +223,7 @@ obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \ omap_phy_internal.o obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \ omap_phy_internal.o +obj-$(CONFIG_MACH_OMAP4_DT) += board-omap4-dt.o obj-$(CONFIG_MACH_PCM049) += board-omap4pcm049.o \ omap_phy_internal.o diff --git a/arch/arm/mach-omap2/board-omap4-dt.c b/arch/arm/mach-omap2/board-omap4-dt.c new file mode 100644 index 0000000..9553cf1 --- /dev/null +++ b/arch/arm/mach-omap2/board-omap4-dt.c @@ -0,0 +1,110 @@ +/* + * OMAP4 Device tree boards support + * + * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +#include "mux.h" +#include "common-board-devices.h" + + +static void __init omap4_map_io(void) +{ + omap2_set_globals_443x(); + omap44xx_map_common_io(); +} + +static void __init omap_init_early(void) +{ + omap2_init_common_infrastructure(); + /* + * XXX: That name is misleading because it does call only + * omap2_sdrc_init in the case of OMAP 2&3 platform. + * It is a no-op in the case of OMAP4, but keep it for the moment. + * It should be replaced by a init_memory_controller kind of function + * that will use DT to get the proper memory controller config. + */ + omap2_init_common_devices(NULL, NULL); +} + +static struct of_device_id omap_dt_match_table[] __initdata = { + { .compatible = "simple-bus", }, + { .compatible = "ti,omap-infra", }, + {} +}; + +static struct of_device_id omap_dt_gic_match[] __initdata = { + { .compatible = "ti,omap4-gic", }, + {} +}; + +/* + * XXX: Still needed to boot until the i2c & twl driver is adapted to + * device-tree + */ +static struct twl4030_platform_data sdp4430_twldata = { + .irq_base = TWL6030_IRQ_BASE, + .irq_end = TWL6030_IRQ_END, +}; + +static void __init omap4_i2c_init(void) +{ + omap4_pmic_init("twl6030", &sdp4430_twldata); +} + +static void __init omap4_init_machine(void) +{ + int package = OMAP_PACKAGE_CBS; + struct device_node *node; + + node = of_find_matching_node(NULL, omap_dt_gic_match); + if (node) + irq_domain_add_simple(node, 0); + + if (omap_rev() == OMAP4430_REV_ES1_0) + package = OMAP_PACKAGE_CBL; + omap4_mux_init(NULL, NULL, package); + + omap4_i2c_init(); + /* + * XXX: Still needed to boot until the omap-serial driver is adapted + * to device-tree + */ + omap_serial_init(); + + of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); +} + +static const char *omap4_boards_compat[] __initdata = { + "ti,omap4", + NULL, +}; + +DT_MACHINE_START(OMAP4_DT, "OMAP4 (Flattened Device Tree)") + .reserve = omap_reserve, + .map_io = omap4_map_io, + .init_early = omap_init_early, + .init_irq = gic_init_irq, + .init_machine = omap4_init_machine, + .timer = &omap4_timer, + .dt_compat = omap4_boards_compat, +MACHINE_END