From patchwork Wed Jul 4 10:56:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 1155641 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 47B453FC36 for ; Wed, 4 Jul 2012 11:01:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SmNHB-0002oQ-N0; Wed, 04 Jul 2012 10:57:41 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SmNGz-0002no-8l for linux-arm-kernel@lists.infradead.org; Wed, 04 Jul 2012 10:57:32 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id E6AECF0940; Wed, 4 Jul 2012 12:57:21 +0200 (CEST) Date: Wed, 4 Jul 2012 12:56:53 +0200 From: Pavel Machek To: Thomas Petazzoni Subject: Re: [RFC PATCHv1 1/2] ARM: socfpga: initial support for Altera's SOCFPGA platform. Message-ID: <20120704105653.GA20021@elf.ucw.cz> References: <1340805007-3313-1-git-send-email-dinguyen@altera.com> <1340805007-3313-2-git-send-email-dinguyen@altera.com> <20120627162014.1494cdd7@skate> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120627162014.1494cdd7@skate> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [195.113.26.193 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arm-kernel@lists.infradead.org, cytan@altera.com, linux@arm.linux.org.uk, wd@denx.de, dinguyen@altera.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi! > > +struct plat_serial8250_port uart_platform_data[] = { > > + { > > + .type = PORT_16850, > > + .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | \ > > + UPF_FIXED_TYPE, > > + }, > > +}; > > This sounds strange. Why aren't you using the ns16850 compatible string > to instantiate the UART devices directly from your device tree? Hmm, strange. I see picoxcell-pc3x2.dtsi using similar dw-apb-uart. According to 8250_dw.c, it is not completely 16550-compatible, and uses slightly modified driver. So it can be driven from dts, but not as ns16850 compatible. This patch does so. Signed-off-by: Pavel Machek diff --git a/arch/arm/mach-socfpga/common.c b/arch/arm/mach-socfpga/common.c index 0df10ef..ae310a5 100644 --- a/arch/arm/mach-socfpga/common.c +++ b/arch/arm/mach-socfpga/common.c @@ -45,20 +45,9 @@ extern struct dw_mci_board sdmmc_platform_data; extern struct dma_pl330_platdata dma_platform_data; -#define DW_APB_UART_OF_COMPATIBLE "snps,dw-apb-uart" - #define SOCFPGA_MPU_PERIHCLK_FREQ_HZ (800000000 / 4) #define SOCFPGA_L4_MAIN_CLK (400000000) - -struct plat_serial8250_port uart_platform_data[] = { - { - .type = PORT_16850, - .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | \ - UPF_FIXED_TYPE, - }, -}; - void __init socfpga_init_clocks(void) { struct clk *dummy_apb_pclk; @@ -126,12 +115,3 @@ void __init socfpga_timer_init(void __iomem *src_timer_base, dwapbt_clocksource_init(src_timer_base); dwapbt_clockevents_init(event_timer_base, event_timer_irq); } - -int socfpga_notifier(struct device *device) -{ - struct device_node *dn = device->of_node; - - if (of_device_is_compatible(dn, DW_APB_UART_OF_COMPATIBLE)) - device->platform_data = &uart_platform_data; - return 0; -} diff --git a/arch/arm/mach-socfpga/socfpga_cyclone5.c b/arch/arm/mach-socfpga/socfpga_cyclone5.c index d8cd89b..d67fc92 100644 --- a/arch/arm/mach-socfpga/socfpga_cyclone5.c +++ b/arch/arm/mach-socfpga/socfpga_cyclone5.c @@ -138,7 +138,6 @@ static void __init socfpga_cyclone5_init(void) /* 8-way, 64K/way, evmon/parity/share */ l2x0_of_init(0x00760000, 0xfe000fff); #endif - platform_notify = socfpga_notifier; of_platform_populate(NULL, of_default_bus_match_table, cyclone5_auxdata_lookup, NULL); }