From patchwork Thu Sep 27 21:52:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 187485 X-Patchwork-Delegate: twarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6EFD32C020C for ; Fri, 28 Sep 2012 07:52:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8648C2807E; Thu, 27 Sep 2012 23:52:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pTH8u752BZRc; Thu, 27 Sep 2012 23:52:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 927C22808A; Thu, 27 Sep 2012 23:52:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4DE6528080 for ; Thu, 27 Sep 2012 23:52:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DBsOQdn+0Evv for ; Thu, 27 Sep 2012 23:52:08 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from km20343-01.keymachine.de (ns.km20343-01.keymachine.de [84.19.182.79]) by theia.denx.de (Postfix) with ESMTP id 1D52F2807E for ; Thu, 27 Sep 2012 23:52:07 +0200 (CEST) Received: from localhost.localdomain (g229037233.adsl.alicedsl.de [92.229.37.233]) by km20343-01.keymachine.de (Postfix) with ESMTPA id 6C94E7D416E; Thu, 27 Sep 2012 23:52:07 +0200 (CEST) From: Lucas Stach To: Tom Warren Date: Thu, 27 Sep 2012 23:52:03 +0200 Message-Id: <1348782724-19151-1-git-send-email-dev@lynxeye.de> X-Mailer: git-send-email 1.7.11.4 MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] =?utf-8?q?=5BPATCH_1/2=5D_tegra=3A_clean_up_board_includ?= =?utf-8?q?e_hell?= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The prototypes used in board files were all scattered out, which lead to code duplication between SPL and normal U-Boot and some prototypes not actually being used. Consolidate this in a common board header. This will allow to push down the calling of the pinmux functions into the respective drivers and this way cut down on complexity from the common board code. Signed-off-by: Lucas Stach --- arch/arm/cpu/arm720t/tegra-common/board.h | 25 --------------------- arch/arm/cpu/arm720t/tegra-common/spl.c | 2 +- arch/arm/cpu/tegra-common/board.c | 1 + arch/arm/include/asm/arch-tegra/board.h | 19 +++++++++++++++- board/nvidia/common/board.c | 1 - board/nvidia/common/board.h | 37 ------------------------------- board/nvidia/common/uart-spi-switch.c | 2 +- 7 Dateien geändert, 21 Zeilen hinzugefügt(+), 66 Zeilen entfernt(-) delete mode 100644 arch/arm/cpu/arm720t/tegra-common/board.h delete mode 100644 board/nvidia/common/board.h diff --git a/arch/arm/cpu/arm720t/tegra-common/board.h b/arch/arm/cpu/arm720t/tegra-common/board.h deleted file mode 100644 index 260767d..0000000 --- a/arch/arm/cpu/arm720t/tegra-common/board.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (C) Copyright 2010-2011 - * NVIDIA Corporation - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -void board_init_uart_f(void); -void gpio_early_init_uart(void); diff --git a/arch/arm/cpu/arm720t/tegra-common/spl.c b/arch/arm/cpu/arm720t/tegra-common/spl.c index dfe36b9..0d37ce8 100644 --- a/arch/arm/cpu/arm720t/tegra-common/spl.c +++ b/arch/arm/cpu/arm720t/tegra-common/spl.c @@ -33,13 +33,13 @@ #include #include #include -#include "board.h" #include "cpu.h" #include #include #include #include +#include #include #include #include diff --git a/arch/arm/cpu/tegra-common/board.c b/arch/arm/cpu/tegra-common/board.c index ff90a52..b2e10c6 100644 --- a/arch/arm/cpu/tegra-common/board.c +++ b/arch/arm/cpu/tegra-common/board.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/include/asm/arch-tegra/board.h b/arch/arm/include/asm/arch-tegra/board.h index a90d36c..7e56df7 100644 --- a/arch/arm/include/asm/arch-tegra/board.h +++ b/arch/arm/include/asm/arch-tegra/board.h @@ -24,7 +24,24 @@ #ifndef _TEGRA_BOARD_H_ #define _TEGRA_BOARD_H_ -/* Setup UARTs for the board according to the selected config */ +/* Set up pinmux to make UART usable */ +void gpio_config_uart(void); /* CONFIG_SPI_UART_SWITCH */ +void gpio_early_init_uart(void); /*!CONFIG_SPI_UART_SWITCH */ + +/* Set up early UART output */ void board_init_uart_f(void); +/* Set up any early GPIOs the board might need for proper operation */ +void gpio_early_init(void); /* overrideable GPIO config */ + +/* + * Hooks to allow boards to set up the pinmux for a specific function. + * Has to be implemented in the board files as we don't yet support pinmux + * setup from FTD. If a board file does not implement one of those functions + * an empty stub function will be called. + */ + +void pin_mux_usb(void); /* overrideable USB pinmux setup */ +void pin_mux_spi(void); /* overrideable SPI pinmux setup */ + #endif diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index bd194bc..dc301e7 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -39,7 +39,6 @@ #include #include #include -#include "board.h" #include "emc.h" DECLARE_GLOBAL_DATA_PTR; diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h deleted file mode 100644 index dada4c4..0000000 --- a/board/nvidia/common/board.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright 2010,2011 - * NVIDIA Corporation - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -void gpio_config_uart(void); -void gpio_early_init(void); -void gpio_early_init_uart(void); - -/* - * Set up any pin muxing needed for USB (for now, since fdt doesn't support - * it). Boards can overwrite the default fucction which does nothing. - */ -void pin_mux_usb(void); - -#endif /* BOARD_H */ diff --git a/board/nvidia/common/uart-spi-switch.c b/board/nvidia/common/uart-spi-switch.c index a0aeb7f..e9d445d 100644 --- a/board/nvidia/common/uart-spi-switch.c +++ b/board/nvidia/common/uart-spi-switch.c @@ -26,7 +26,7 @@ #include #include #include - +#include /* position of the UART/SPI select switch */ enum spi_uart_switch {