From 9c4c79f4321178a258e9bc98b0452b3ed5db337d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 15 Sep 2017 21:13:58 +0200 Subject: [PATCH] ARM: rmobile: Zap ad-hoc PFC and GPIO setup in board files At long last, nuke all this ad-hoc setup in board files in favor of letting PFC pinmux and GPIO drivers do the same job, but based on DT description of the hardware rather than this board-file ugliness. Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu --- board/renesas/salvator-x/salvator-x.c | 117 -------------------------- board/renesas/ulcb/ulcb.c | 80 ------------------ 2 files changed, 197 deletions(-) diff --git a/board/renesas/salvator-x/salvator-x.c b/board/renesas/salvator-x/salvator-x.c index 9d9de58370..debd1db721 100644 --- a/board/renesas/salvator-x/salvator-x.c +++ b/board/renesas/salvator-x/salvator-x.c @@ -82,15 +82,6 @@ int board_init(void) /* adress of boot parameters */ gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000; -#ifdef CONFIG_SH_GPIO_PFC - /* Init PFC controller */ -#if defined(CONFIG_R8A7795) - r8a7795_pinmux_init(); -#elif defined(CONFIG_R8A7796) - r8a7796_pinmux_init(); -#endif -#endif - #if defined(CONFIG_R8A7795) /* GSX: force power and clock supply */ writel(0x0000001F, SYSC_PWRONCR2); @@ -111,114 +102,6 @@ int board_init(void) /* low power status */ setbits_le16(HSUSB_REG_LPSTS, HSUSB_REG_LPSTS_SUSPM_NORMAL); -#ifdef CONFIG_RENESAS_RAVB - /* EtherAVB Enable */ - /* GPSR2 */ - gpio_request(GPIO_GFN_AVB_AVTP_CAPTURE_A, NULL); - gpio_request(GPIO_GFN_AVB_AVTP_MATCH_A, NULL); - gpio_request(GPIO_GFN_AVB_LINK, NULL); - gpio_request(GPIO_GFN_AVB_PHY_INT, NULL); - gpio_request(GPIO_GFN_AVB_MAGIC, NULL); - gpio_request(GPIO_GFN_AVB_MDC, NULL); - - /* IPSR0 */ - gpio_request(GPIO_IFN_AVB_MDC, NULL); - gpio_request(GPIO_IFN_AVB_MAGIC, NULL); - gpio_request(GPIO_IFN_AVB_PHY_INT, NULL); - gpio_request(GPIO_IFN_AVB_LINK, NULL); - gpio_request(GPIO_IFN_AVB_AVTP_MATCH_A, NULL); - gpio_request(GPIO_IFN_AVB_AVTP_CAPTURE_A, NULL); - /* IPSR1 */ - gpio_request(GPIO_FN_AVB_AVTP_PPS, NULL); - /* IPSR2 */ - gpio_request(GPIO_FN_AVB_AVTP_MATCH_B, NULL); - /* IPSR3 */ - gpio_request(GPIO_FN_AVB_AVTP_CAPTURE_B, NULL); - -#if defined(CONFIG_R8A7795) - /* USB2_OVC */ - gpio_request(GPIO_GP_6_15, NULL); - gpio_direction_input(GPIO_GP_6_15); - - /* USB2_PWEN */ - gpio_request(GPIO_GP_6_14, NULL); - gpio_direction_output(GPIO_GP_6_14, 1); - gpio_set_value(GPIO_GP_6_14, 1); -#endif - /* AVB_PHY_RST */ - gpio_request(GPIO_GP_2_10, NULL); - gpio_direction_output(GPIO_GP_2_10, 0); - mdelay(20); - gpio_set_value(GPIO_GP_2_10, 1); - udelay(1); -#endif - -#ifdef CONFIG_MMC - /* SDHI0 */ - gpio_request(GPIO_GFN_SD0_DAT0, NULL); - gpio_request(GPIO_GFN_SD0_DAT1, NULL); - gpio_request(GPIO_GFN_SD0_DAT2, NULL); - gpio_request(GPIO_GFN_SD0_DAT3, NULL); - gpio_request(GPIO_GFN_SD0_CLK, NULL); - gpio_request(GPIO_GFN_SD0_CMD, NULL); - gpio_request(GPIO_GFN_SD0_CD, NULL); - gpio_request(GPIO_GFN_SD0_WP, NULL); - - gpio_request(GPIO_GP_5_2, NULL); - gpio_request(GPIO_GP_5_1, NULL); - gpio_direction_output(GPIO_GP_5_2, 1); /* power on */ - gpio_direction_output(GPIO_GP_5_1, 1); /* 1: 3.3V, 0: 1.8V */ - - /* SDHI1/SDHI2 eMMC */ - gpio_request(GPIO_GFN_SD1_DAT0, NULL); - gpio_request(GPIO_GFN_SD1_DAT1, NULL); - gpio_request(GPIO_GFN_SD1_DAT2, NULL); - gpio_request(GPIO_GFN_SD1_DAT3, NULL); - gpio_request(GPIO_GFN_SD2_DAT0, NULL); - gpio_request(GPIO_GFN_SD2_DAT1, NULL); - gpio_request(GPIO_GFN_SD2_DAT2, NULL); - gpio_request(GPIO_GFN_SD2_DAT3, NULL); - gpio_request(GPIO_GFN_SD2_CLK, NULL); -#if defined(CONFIG_R8A7795) - gpio_request(GPIO_GFN_SD2_CMD, NULL); -#elif defined(CONFIG_R8A7796) - gpio_request(GPIO_FN_SD2_CMD, NULL); -#else -#error Only R8A7795 and R87796 is supported -#endif - gpio_request(GPIO_GP_5_3, NULL); - gpio_request(GPIO_GP_5_9, NULL); - gpio_direction_output(GPIO_GP_5_3, 0); /* 1: 3.3V, 0: 1.8V */ - gpio_direction_output(GPIO_GP_5_9, 0); /* 1: 3.3V, 0: 1.8V */ - -#if defined(CONFIG_R8A7795) - /* SDHI3 */ - gpio_request(GPIO_GFN_SD3_DAT0, NULL); /* GP_4_9 */ - gpio_request(GPIO_GFN_SD3_DAT1, NULL); /* GP_4_10 */ - gpio_request(GPIO_GFN_SD3_DAT2, NULL); /* GP_4_11 */ - gpio_request(GPIO_GFN_SD3_DAT3, NULL); /* GP_4_12 */ - gpio_request(GPIO_GFN_SD3_CLK, NULL); /* GP_4_7 */ - gpio_request(GPIO_GFN_SD3_CMD, NULL); /* GP_4_8 */ -#elif defined(CONFIG_R8A7796) - gpio_request(GPIO_FN_SD3_DAT0, NULL); /* GP_4_9 */ - gpio_request(GPIO_FN_SD3_DAT1, NULL); /* GP_4_10 */ - gpio_request(GPIO_FN_SD3_DAT2, NULL); /* GP_4_11 */ - gpio_request(GPIO_FN_SD3_DAT3, NULL); /* GP_4_12 */ - gpio_request(GPIO_FN_SD3_CLK, NULL); /* GP_4_7 */ - gpio_request(GPIO_FN_SD3_CMD, NULL); /* GP_4_8 */ -#else -#error Only R8A7795 and R87796 is supported -#endif - /* IPSR10 */ - gpio_request(GPIO_FN_SD3_CD, NULL); - gpio_request(GPIO_FN_SD3_WP, NULL); - - gpio_request(GPIO_GP_3_15, NULL); - gpio_request(GPIO_GP_3_14, NULL); - gpio_direction_output(GPIO_GP_3_15, 1); /* power on */ - gpio_direction_output(GPIO_GP_3_14, 1); /* 1: 3.3V, 0: 1.8V */ -#endif - return 0; } diff --git a/board/renesas/ulcb/ulcb.c b/board/renesas/ulcb/ulcb.c index 3ee6990b57..ca1b71975b 100644 --- a/board/renesas/ulcb/ulcb.c +++ b/board/renesas/ulcb/ulcb.c @@ -81,15 +81,6 @@ int board_init(void) /* adress of boot parameters */ gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000; -#ifdef CONFIG_SH_GPIO_PFC - /* Init PFC controller */ -#if defined(CONFIG_R8A7795) - r8a7795_pinmux_init(); -#elif defined(CONFIG_R8A7796) - r8a7796_pinmux_init(); -#endif -#endif - /* USB1 pull-up */ setbits_le32(PFC_PUEN6, PUEN_USB1_OVC | PUEN_USB1_PWEN); @@ -101,77 +92,6 @@ int board_init(void) /* low power status */ setbits_le16(HSUSB_REG_LPSTS, HSUSB_REG_LPSTS_SUSPM_NORMAL); -#ifdef CONFIG_RENESAS_RAVB - /* EtherAVB Enable */ - /* GPSR2 */ - gpio_request(GPIO_GFN_AVB_AVTP_CAPTURE_A, NULL); - gpio_request(GPIO_GFN_AVB_AVTP_MATCH_A, NULL); - gpio_request(GPIO_GFN_AVB_LINK, NULL); - gpio_request(GPIO_GFN_AVB_PHY_INT, NULL); - gpio_request(GPIO_GFN_AVB_MAGIC, NULL); - gpio_request(GPIO_GFN_AVB_MDC, NULL); - - /* IPSR0 */ - gpio_request(GPIO_IFN_AVB_MDC, NULL); - gpio_request(GPIO_IFN_AVB_MAGIC, NULL); - gpio_request(GPIO_IFN_AVB_PHY_INT, NULL); - gpio_request(GPIO_IFN_AVB_LINK, NULL); - gpio_request(GPIO_IFN_AVB_AVTP_MATCH_A, NULL); - gpio_request(GPIO_IFN_AVB_AVTP_CAPTURE_A, NULL); - /* IPSR1 */ - gpio_request(GPIO_FN_AVB_AVTP_PPS, NULL); - /* IPSR2 */ - gpio_request(GPIO_FN_AVB_AVTP_MATCH_B, NULL); - /* IPSR3 */ - gpio_request(GPIO_FN_AVB_AVTP_CAPTURE_B, NULL); - - /* AVB_PHY_RST */ - gpio_request(GPIO_GP_2_10, NULL); - gpio_direction_output(GPIO_GP_2_10, 0); - mdelay(20); - gpio_set_value(GPIO_GP_2_10, 1); - udelay(1); -#endif - -#ifdef CONFIG_MMC - /* SDHI0 */ - gpio_request(GPIO_GFN_SD0_DAT0, NULL); - gpio_request(GPIO_GFN_SD0_DAT1, NULL); - gpio_request(GPIO_GFN_SD0_DAT2, NULL); - gpio_request(GPIO_GFN_SD0_DAT3, NULL); - gpio_request(GPIO_GFN_SD0_CLK, NULL); - gpio_request(GPIO_GFN_SD0_CMD, NULL); - gpio_request(GPIO_GFN_SD0_CD, NULL); - gpio_request(GPIO_GFN_SD0_WP, NULL); - - gpio_request(GPIO_GP_5_2, NULL); - gpio_request(GPIO_GP_5_1, NULL); - gpio_direction_output(GPIO_GP_5_2, 1); /* power on */ - gpio_direction_output(GPIO_GP_5_1, 1); /* 1: 3.3V, 0: 1.8V */ - - /* SDHI1/SDHI2 eMMC */ - gpio_request(GPIO_GFN_SD1_DAT0, NULL); - gpio_request(GPIO_GFN_SD1_DAT1, NULL); - gpio_request(GPIO_GFN_SD1_DAT2, NULL); - gpio_request(GPIO_GFN_SD1_DAT3, NULL); - gpio_request(GPIO_GFN_SD2_DAT0, NULL); - gpio_request(GPIO_GFN_SD2_DAT1, NULL); - gpio_request(GPIO_GFN_SD2_DAT2, NULL); - gpio_request(GPIO_GFN_SD2_DAT3, NULL); - gpio_request(GPIO_GFN_SD2_CLK, NULL); -#if defined(CONFIG_R8A7795) - gpio_request(GPIO_GFN_SD2_CMD, NULL); -#elif defined(CONFIG_R8A7796) - gpio_request(GPIO_FN_SD2_CMD, NULL); -#else -#error Only R8A7795 and R87796 is supported -#endif - gpio_request(GPIO_GP_5_3, NULL); - gpio_request(GPIO_GP_5_9, NULL); - gpio_direction_output(GPIO_GP_5_3, 0); /* 1: 3.3V, 0: 1.8V */ - gpio_direction_output(GPIO_GP_5_9, 0); /* 1: 3.3V, 0: 1.8V */ -#endif - return 0; } -- 2.25.1