tegra2: Add more clock/pinmux functionality
Subsystems (3)
v2 cover tegra2: Add more clock/pinmux functionality
This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID.
Functions are provided to start, query and adjust peripheral clocks, including automatic selection of the best available clock based on the requested rate (this replaces hard-coded divisors).
On the pinmux side we can now select functions for pin groups using the new pinmux_set_func() function.
Expanded functions are provided to adjust and query PLL clocks.
With a full compliment of clock and pinmux functions, it should no longer be necessary for board/driver code to directly access clock registers. This change removes all such accesses.
This functionality will be used for I2C, SPI, LCD, USB, keyboard, NAND and other drivers for Tegra2.
At then end is a patch to enable MMC on Seaboard, to make it all worthwhile.
Note: These patches include a definition of assert() which I will happily remove if the one sent upstream is accepted.
Changes in v2:
- Remove assert() which is now in common.h
Simon Glass (6):
tegra2: Rename CLOCK_PLL_ID to CLOCK_ID
tegra2: Clean up board code a little
tegra2: Add more clock functions
tegra2: Rename PIN_ to PINGRP_
tegra2: Add more pinmux functions
tegra2: Enable MMC for Seaboard
arch/arm/cpu/armv7/tegra2/ap20.c | 5 +- arch/arm/cpu/armv7/tegra2/clock.c | 825 +++++++++++++++++++++++++++- arch/arm/cpu/armv7/tegra2/pinmux.c | 528 ++++++++++++++++++- arch/arm/include/asm/arch-tegra2/clk_rst.h | 84 +-- arch/arm/include/asm/arch-tegra2/clock.h | 149 ++++- arch/arm/include/asm/arch-tegra2/pinmux.h | 444 ++++++++++----- board/nvidia/common/board.c | 243 +++------ board/nvidia/common/board.h | 4 +- board/nvidia/harmony/harmony.c | 26 + board/nvidia/seaboard/seaboard.c | 35 ++- drivers/mmc/tegra2_mmc.c | 94 ++-- drivers/mmc/tegra2_mmc.h | 1 + 12 files changed, 1950 insertions(+), 488 deletions(-)
Signature · 1 line
1.7.3.1
PATCH v2 1/6 tegra2: Rename CLOCK_PLL_ID to CLOCK_ID
Rename CLOCK_PLL_ID to CLOCK_ID which takes account of the fact that the code now deals with both PLL clocks and source clocks.
This also tidied up the assert() to match the one sent upstream, and fixes an error in the PWM id.
--- arch/arm/cpu/armv7/tegra2/ap20.c | 2 +- arch/arm/cpu/armv7/tegra2/clock.c | 6 ++-- arch/arm/include/asm/arch-tegra2/clock.h | 43 ++++++++++++++--------------- board/nvidia/common/board.c | 2 +- 4 files changed, 26 insertions(+), 27 deletions(-)
arch/arm/cpu/armv7/tegra2/ap20.c +1 -1
@@ -36,7 +36,7 @@ u32 s_first_boot = 1;void init_pllx (void ) {struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE ; -struct clk_pll *pll = &clkrst->crc_pll[CLOCK_PLL_ID_XCPU ]; +struct clk_pll *pll = &clkrst->crc_pll[CLOCK_ID_XCPU ];u32 reg;/* If PLLX is already enabled, just return */
arch/arm/cpu/armv7/tegra2/clock.c +3 -3
@@ -42,7 +42,7 @@ enum clock_osc_freq clock_get_osc_freq(void)return (reg &OSC_FREQ_MASK ) >>OSC_FREQ_SHIFT ; } -unsigned long clock_start_pll (enum clock_pll_id clkid,u32 divm,u32 divn, +unsigned long clock_start_pll (enum clock_id clkid,u32 divm,u32 divn,u32 divp,u32 cpcon,u32 lfcon) { struct clk_rst_ctlr *clkrst =
@@ -50,7 +50,7 @@ unsigned long clock_start_pll(enum clock_pll_id clkid, u32 divm, u32 divn,u32 data;struct clk_pll *pll; -assert (clock_pll_id_isvalid (clkid)); +assert (clock_id_isvalid (clkid)); pll = &clkrst->crc_pll[clkid];/*
@@ -66,7 +66,7 @@ unsigned long clock_start_pll(enum clock_pll_id clkid, u32 divm, u32 divn, data = (divm <<PLL_DIVM_SHIFT ) | (divn <<PLL_DIVN_SHIFT ) | (0 <<PLL_BYPASS_SHIFT ) | (1 <<PLL_ENABLE_SHIFT ); -if (clkid ==CLOCK_PLL_ID_USB ) +if (clkid ==CLOCK_ID_USB ) data |= divp <<PLLU_VCO_FREQ_SHIFT ;else data |= divp <<PLL_DIVP_SHIFT ;
arch/arm/include/asm/arch-tegra2/clock.h +21 -22
100 lines not on this page · raw message
board/nvidia/common/board.c +1 -1
@@ -77,7 +77,7 @@ int timer_init(void)static void clock_init_uart (void ) {struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE ; -struct clk_pll *pll = &clkrst->crc_pll[CLOCK_PLL_ID_PERIPH ]; +struct clk_pll *pll = &clkrst->crc_pll[CLOCK_ID_PERIPH ];u32 reg; reg =readl (&pll->pll_base);
Signature · 1 line
1.7.3.1
PATCH v2 2/6 tegra2: Clean up board code a little
In reply to Simon GlassThis removes clock_init() and pinmux_init() which are names better suited to those respective modules. By moving board_init_f() to the bottom of the file we can remove the need for so many functions in the board.h header file.
The only clock/pinmux/gpio init we need to do prior to relocation is for the UART.
--- board/nvidia/common/board.c | 65 +++++++++++++----------------------------- board/nvidia/common/board.h | 3 -- 2 files changed, 20 insertions(+), 48 deletions(-)
board/nvidia/common/board.c +20 -45
@@ -43,24 +43,6 @@ const struct tegra2_sysinfo sysinfo = { CONFIG_TEGRA2_BOARD_STRING }; -#ifdef CONFIG_BOARD_EARLY_INIT_F -int board_early_init_f (void ) -{ -/* Initialize periph clocks */ -clock_init (); - -/* Initialize periph pinmuxes */ -pinmux_init (); - -/* Initialize periph GPIOs */ -gpio_init (); - -/* Init UART, scratch regs, and start CPU */ -tegra2_start (); -return 0 ; -} -#endif /* EARLY_INIT */ -/* * Routine: timer_init * Description: init the timestamp and lastinc value
@@ -155,6 +137,7 @@ static void pin_mux_uart(void)#endif /* CONFIG_TEGRA2_ENABLE_UARTD */ } +#ifdef CONFIG_TEGRA2_MMC /* * Routine: clock_init_mmc * Description: init the PLL and clocks for the SDMMC controllers
@@ -235,33 +218,7 @@ static void pin_mux_mmc(void)pinmux_tristate_disable (PIN_SDD ); pinmux_tristate_disable(PIN_SDB); } - -/* -* Routine: clock_init -* Description: Do individual peripheral clock reset/enables -*/ -void clock_init (void ) -{ -clock_init_uart (); -} - -/* -* Routine: pinmux_init -* Description: Do individual peripheral pinmux configs -*/ -void pinmux_init (void ) -{ -pin_mux_uart (); -} - -/* -* Routine: gpio_init -* Description: Do individual peripheral GPIO configs -*/ -void gpio_init (void ) -{ -gpio_config_uart (); -} +#endif /* * Routine: board_init
@@ -307,3 +264,21 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc) return 0; }#endif + +#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f (void ) +{ +/* Initialize UART clocks */ +clock_init_uart (); + +/* Initialize periph pinmuxes */ +pin_mux_uart (); + +/* Initialize periph GPIOs */ +gpio_config_uart (); + +/* Init UART, scratch regs, and start CPU */ +tegra2_start (); +return 0 ; +} +#endif /* EARLY_INIT */
board/nvidia/common/board.h +0 -3
@@ -25,9 +25,6 @@#define _BOARD_H_void tegra2_start (void ); -void clock_init (void ); -void pinmux_init (void ); -void gpio_init (void );void gpio_config_uart (void );int tegra2_mmc_init (int dev_index,int bus_width);
Signature · 1 line
1.7.3.1
PATCH v2 3/6 tegra2: Add more clock functions
In reply to Simon GlassThis adds most of the clock functions required by board and driver code:
-query and adjust peripheral clocks
-query and adjust PLLs
-reset and enable control
These functions are plumbed in as required.
---
Changes in v2:
- Remove assert() which is now in common.h
arch/arm/cpu/armv7/tegra2/ap20.c | 3 +- arch/arm/cpu/armv7/tegra2/clock.c | 821 +++++++++++++++++++++++++++- arch/arm/include/asm/arch-tegra2/clk_rst.h | 84 +-- arch/arm/include/asm/arch-tegra2/clock.h | 108 ++++- board/nvidia/common/board.c | 105 +--- drivers/mmc/tegra2_mmc.c | 92 +-- drivers/mmc/tegra2_mmc.h | 1 + 7 files changed, 999 insertions(+), 215 deletions(-)
arch/arm/cpu/armv7/tegra2/ap20.c +1 -2
@@ -189,7 +189,6 @@ static void reset_A9_cpu(int reset)static void clock_enable_coresight (int enable) { -struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE ;u32 rst, src;clock_set_enable (PERIPH_ID_CORESIGHT , enable);
@@ -203,7 +202,7 @@ static void clock_enable_coresight(int enable)* (bits 7:0), so 00000001b == 1.5 (n+1 + .5) */ src =CLK_DIVIDER (NVBL_PLLP_KHZ ,144000 ); -writel (src, &clkrst->crc_clk_src_csite); +clock_ll_set_source_divisor (PERIPH_ID_CSI ,0 , src);/* Unlock the CPU CoreSight interfaces */ rst =0xC5ACCE55 ;
arch/arm/cpu/armv7/tegra2/clock.c +816 -5
847 lines not on this page · raw message
arch/arm/include/asm/arch-tegra2/clk_rst.h +23 -61
116 lines not on this page · raw message
arch/arm/include/asm/arch-tegra2/clock.h +103 -5
130 lines not on this page · raw message
board/nvidia/common/board.c +24 -81
138 lines not on this page · raw message
drivers/mmc/tegra2_mmc.c +31 -61
157 lines not on this page · raw message
drivers/mmc/tegra2_mmc.h +1 -0
@@ -73,6 +73,7 @@ struct mmc_host {unsigned int version;/* SDHCI spec. version */ unsigned int clock;/* Current clock (MHz) */ unsigned int base;/* Base address, SDMMC1/2/3/4 */ +enum periph_id mmc_id;/* Peripheral ID: PERIPH_ID_... */ };int tegra2_mmc_init (int dev_index,int bus_width);
Signature · 1 line
1.7.3.1
PATCH v2 4/6 tegra2: Rename PIN_ to PINGRP_
In reply to Simon GlassThe pin groupings are better named PINGRP, since on Tegra2 they refer to multiple pins.
Sorry about this, but better to get it right now when there is only a small amount of code affected.
--- arch/arm/cpu/armv7/tegra2/pinmux.c | 6 +- arch/arm/include/asm/arch-tegra2/pinmux.h | 272 ++++++++++++++-------------- board/nvidia/common/board.c | 18 +- 3 files changed, 148 insertions(+), 148 deletions(-)
arch/arm/cpu/armv7/tegra2/pinmux.c +3 -3
@@ -27,7 +27,7 @@#include <common.h> -void pinmux_set_tristate (enum pmux_pin pin,int enable) +void pinmux_set_tristate (enum pmux_pingrp pin,int enable) {struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE ;u32 *tri = &pmt->pmt_tri[TRISTATE_REG (pin)];
@@ -41,12 +41,12 @@ void pinmux_set_tristate(enum pmux_pin pin, int enable)writel (reg, tri); } -void pinmux_tristate_enable (enum pmux_pin pin) +void pinmux_tristate_enable (enum pmux_pingrp pin) {pinmux_set_tristate (pin,1 ); } -void pinmux_tristate_disable (enum pmux_pin pin) +void pinmux_tristate_disable (enum pmux_pingrp pin) {pinmux_set_tristate (pin,0 ); }
arch/arm/include/asm/arch-tegra2/pinmux.h +136 -136
298 lines not on this page · raw message
board/nvidia/common/board.c +9 -9
@@ -94,15 +94,15 @@ static void pin_mux_uart(void) reg &=0xFFF0FFFF ;/* IRRX_/IRTX_SEL [19:16] = 00 UARTA */ writel (reg, &pmt->pmt_ctl_c); -pinmux_tristate_disable (PIN_IRRX ); -pinmux_tristate_disable (PIN_IRTX ); +pinmux_tristate_disable (PINGRP_IRRX ); +pinmux_tristate_disable (PINGRP_IRTX );#endif /* CONFIG_TEGRA2_ENABLE_UARTA */ #if defined(CONFIG_TEGRA2_ENABLE_UARTD ) reg =readl (&pmt->pmt_ctl_b); reg &=0xFFFFFFF3 ;/* GMC_SEL [3:2] = 00, UARTD */ writel (reg, &pmt->pmt_ctl_b); -pinmux_tristate_disable (PIN_GMC ); +pinmux_tristate_disable (PINGRP_GMC );#endif /* CONFIG_TEGRA2_ENABLE_UARTD */ }
@@ -138,9 +138,9 @@ static void pin_mux_mmc(void) reg |= (3 <<0 );/* GME_SEL [1:0] = 11 SDIO4 */ writel (reg, &pmt->pmt_ctl_d); -pinmux_tristate_disable (PIN_ATB ); -pinmux_tristate_disable (PIN_GMA ); -pinmux_tristate_disable (PIN_GME ); +pinmux_tristate_disable (PINGRP_ATB ); +pinmux_tristate_disable (PINGRP_GMA ); +pinmux_tristate_disable (PINGRP_GME );/* SDMMC3 */ /* SDIO3_CLK, SDIO3_CMD, SDIO3_DAT[3:0] */
@@ -151,9 +151,9 @@ static void pin_mux_mmc(void) reg |= (2 <<14 );/* SDD_SEL [15:14] = 01 SDIO3 */ writel (reg, &pmt->pmt_ctl_d); -pinmux_tristate_disable (PIN_SDC ); -pinmux_tristate_disable (PIN_SDD ); - pinmux_tristate_disable(PIN_SDB); +pinmux_tristate_disable (PINGRP_SDC ); +pinmux_tristate_disable (PINGRP_SDD ); + pinmux_tristate_disable(PINGRP_SDB); }#endif
Signature · 1 line
1.7.3.1
PATCH v2 5/6 tegra2: Add more pinmux functions
In reply to Simon GlassThis adds support for changing pinmux functions of pin groups. This is done by defining a PMUX_FUNC_... enum which can be used to select the function for each group using pinmux_set_func(). It is also possible to enable pullup/pulldown, and the existing tristate functionality is retained.
Also provided is a means of configuring a list of pingroups by providing a configuration table to pinmux_config_table().
---
Changes in v2:
- Remove assert() which is now in common.h
arch/arm/cpu/armv7/tegra2/pinmux.c | 522 ++++++++++++++++++++++++++++- arch/arm/include/asm/arch-tegra2/pinmux.h | 192 ++++++++++- board/nvidia/common/board.c | 42 +-- 3 files changed, 707 insertions(+), 49 deletions(-)
arch/arm/cpu/armv7/tegra2/pinmux.c +521 -1
@@ -27,9 +27,463 @@#include <common.h> +/* +* This defines the order of the pin mux control bits in the registers. For +* some reason there is no correspendence between the tristate, pin mux and +* pullup/pulldown registers. +*/ +enum pmux_ctlid { +/* 0: APB_MISC_PP_PIN_MUX_CTL_A_0 */ +MUXCTL_UAA , +MUXCTL_UAB , +MUXCTL_UAC , +MUXCTL_UAD , +MUXCTL_UDA , +MUXCTL_RESERVED5 , +MUXCTL_ATE , +MUXCTL_RM , + +MUXCTL_ATB , +MUXCTL_RESERVED9 , +MUXCTL_ATD , +MUXCTL_ATC , +MUXCTL_ATA , +MUXCTL_KBCF , +MUXCTL_KBCE , +MUXCTL_SDMMC1 , + +/* 16: APB_MISC_PP_PIN_MUX_CTL_B_0 */ +MUXCTL_GMA , +MUXCTL_GMC , +MUXCTL_HDINT , +MUXCTL_SLXA , +MUXCTL_OWC , +MUXCTL_SLXC , +MUXCTL_SLXD , +MUXCTL_SLXK , + +MUXCTL_UCA , +MUXCTL_UCB , +MUXCTL_DTA , +MUXCTL_DTB , +MUXCTL_RESERVED28 , +MUXCTL_DTC , +MUXCTL_DTD , +MUXCTL_DTE , + +/* 32: APB_MISC_PP_PIN_MUX_CTL_C_0 */ +MUXCTL_DDC , +MUXCTL_CDEV1 , +MUXCTL_CDEV2 , +MUXCTL_CSUS , +MUXCTL_I2CP , +MUXCTL_KBCA , +MUXCTL_KBCB , +MUXCTL_KBCC , + +MUXCTL_IRTX , +MUXCTL_IRRX , +MUXCTL_DAP1 , +MUXCTL_DAP2 , +MUXCTL_DAP3 , +MUXCTL_DAP4 , +MUXCTL_GMB , +MUXCTL_GMD , + +/* 48: APB_MISC_PP_PIN_MUX_CTL_D_0 */ +MUXCTL_GME , +MUXCTL_GPV , +MUXCTL_GPU , +MUXCTL_SPDO , +MUXCTL_SPDI , +MUXCTL_SDB , +MUXCTL_SDC , +MUXCTL_SDD , + +MUXCTL_SPIH , +MUXCTL_SPIG , +MUXCTL_SPIF , +MUXCTL_SPIE , +MUXCTL_SPID , +MUXCTL_SPIC , +MUXCTL_SPIB , +MUXCTL_SPIA , + +/* 64: APB_MISC_PP_PIN_MUX_CTL_E_0 */ +MUXCTL_LPW0 , +MUXCTL_LPW1 , +MUXCTL_LPW2 , +MUXCTL_LSDI , +MUXCTL_LSDA , +MUXCTL_LSPI , +MUXCTL_LCSN , +MUXCTL_LDC , + +MUXCTL_LSCK , +MUXCTL_LSC0 , +MUXCTL_LSC1 , +MUXCTL_LHS , +MUXCTL_LVS , +MUXCTL_LM0 , +MUXCTL_LM1 , +MUXCTL_LVP0 , + +/* 80: APB_MISC_PP_PIN_MUX_CTL_F_0 */ +MUXCTL_LD0 , +MUXCTL_LD1 , +MUXCTL_LD2 , +MUXCTL_LD3 , +MUXCTL_LD4 , +MUXCTL_LD5 , +MUXCTL_LD6 , +MUXCTL_LD7 , + +MUXCTL_LD8 , +MUXCTL_LD9 , +MUXCTL_LD10 , +MUXCTL_LD11 , +MUXCTL_LD12 , +MUXCTL_LD13 , +MUXCTL_LD14 , +MUXCTL_LD15 , + +/* 96: APB_MISC_PP_PIN_MUX_CTL_G_0 */ +MUXCTL_LD16 , +MUXCTL_LD17 , +MUXCTL_LHP1 , +MUXCTL_LHP2 , +MUXCTL_LVP1 , +MUXCTL_LHP0 , +MUXCTL_RESERVED102 , +MUXCTL_LPP , + +MUXCTL_LDI , +MUXCTL_PMC , +MUXCTL_CRTP , +MUXCTL_PTA , +MUXCTL_RESERVED108 , +MUXCTL_KBCD , +MUXCTL_GPU7 , +MUXCTL_DTF , + +MUXCTL_NONE =-1 , +}; + +/* +* And this defines the order of the pullup/pulldown controls which are again +* in a different order +*/ +enum pmux_pullid { +/* 0: APB_MISC_PP_PULLUPDOWN_REG_A_0 */ +PUCTL_ATA , +PUCTL_ATB , +PUCTL_ATC , +PUCTL_ATD , +PUCTL_ATE , +PUCTL_DAP1 , +PUCTL_DAP2 , +PUCTL_DAP3 , + +PUCTL_DAP4 , +PUCTL_DTA , +PUCTL_DTB , +PUCTL_DTC , +PUCTL_DTD , +PUCTL_DTE , +PUCTL_DTF , +PUCTL_GPV , + +/* 16: APB_MISC_PP_PULLUPDOWN_REG_B_0 */ +PUCTL_RM , +PUCTL_I2CP , +PUCTL_PTA , +PUCTL_GPU7 , +PUCTL_KBCA , +PUCTL_KBCB , +PUCTL_KBCC , +PUCTL_KBCD , + +PUCTL_SPDI , +PUCTL_SPDO , +PUCTL_GPSLXAU , +PUCTL_CRTP , +PUCTL_SLXC , +PUCTL_SLXD , +PUCTL_SLXK , + +/* 32: APB_MISC_PP_PULLUPDOWN_REG_C_0 */ +PUCTL_CDEV1 , +PUCTL_CDEV2 , +PUCTL_SPIA , +PUCTL_SPIB , +PUCTL_SPIC , +PUCTL_SPID , +PUCTL_SPIE , +PUCTL_SPIF , + +PUCTL_SPIG , +PUCTL_SPIH , +PUCTL_IRTX , +PUCTL_IRRX , +PUCTL_GME , +PUCTL_RESERVED45 , +PUCTL_XM2D , +PUCTL_XM2C , + +/* 48: APB_MISC_PP_PULLUPDOWN_REG_D_0 */ +PUCTL_UAA , +PUCTL_UAB , +PUCTL_UAC , +PUCTL_UAD , +PUCTL_UCA , +PUCTL_UCB , +PUCTL_LD17 , +PUCTL_LD19_18 , + +PUCTL_LD21_20 , +PUCTL_LD23_22 , +PUCTL_LS , +PUCTL_LC , +PUCTL_CSUS , +PUCTL_DDRC , +PUCTL_SDC , +PUCTL_SDD , + +/* 64: APB_MISC_PP_PULLUPDOWN_REG_E_0 */ +PUCTL_KBCF , +PUCTL_KBCE , +PUCTL_PMCA , +PUCTL_PMCB , +PUCTL_PMCC , +PUCTL_PMCD , +PUCTL_PMCE , +PUCTL_CK32 , + +PUCTL_UDA , +PUCTL_SDMMC1 , +PUCTL_GMA , +PUCTL_GMB , +PUCTL_GMC , +PUCTL_GMD , +PUCTL_DDC , +PUCTL_OWC , + +PUCTL_NONE =-1 +}; + +struct tegra_pingroup_desc { +const char *name; +enum pmux_func funcs[4 ]; +enum pmux_func func_safe; +enum pmux_vddio vddio; +enum pmux_ctlid ctl_id; +enum pmux_pullid pull_id; +}; + + +/* Converts a pmux_pingrp number to a tristate register: 0=A, 1=B, 2=C, 3=D */ +#define TRISTATE_REG (pmux_pingrp) ((pmux_pingrp) >> 5) + +/* Mask value for a tristate (within TRISTATE_REG(id)) */ +#define TRISTATE_MASK (pmux_pingrp) (1 << ((pmux_pingrp) & 0x1f)) + +/* Converts a PUCTL id to a pull register: 0=A, 1=B...4=E */ +#define PULL_REG (pmux_pullid) ((pmux_pullid) >> 4) + +/* Converts a PUCTL id to a shift position */ +#define PULL_SHIFT (pmux_pullid) ((pmux_pullid << 1) & 0x1f) + +/* Converts a MUXCTL id to a ctl register: 0=A, 1=B...6=G */ +#define MUXCTL_REG (pmux_ctlid) ((pmux_ctlid) >> 4) + +/* Converts a MUXCTL id to a shift position */ +#define MUXCTL_SHIFT (pmux_ctlid) ((pmux_ctlid << 1) & 0x1f) + +/* Convenient macro for defining pin group properties */ +#define PINALL (pg_name, vdd, f0, f1, f2, f3, f_safe, mux, pupd) \ + { \ + .vddio = PMUX_VDDIO_ ## vdd, \ + .funcs = { \ + PMUX_FUNC_ ## f0, \ + PMUX_FUNC_ ## f1, \ + PMUX_FUNC_ ## f2, \ + PMUX_FUNC_ ## f3, \ + }, \ + .func_safe = PMUX_FUNC_ ## f_safe, \ + .ctl_id = mux, \ + .pull_id = pupd \ + } + +/* A normal pin group where the mux name and pull-up name match */ +#define PIN (pg_name, vdd, f0, f1, f2, f3, f_safe) \ + PINALL(pg_name, vdd, f0, f1, f2, f3, f_safe, \ + MUXCTL_ ## pg_name, PUCTL_ ## pg_name) + +/* A pin group where the pull-up name doesn't have a 1-1 mapping */ +#define PINP (pg_name, vdd, f0, f1, f2, f3, f_safe, pupd) \ + PINALL(pg_name, vdd, f0, f1, f2, f3, f_safe, \ + MUXCTL_ ## pg_name, PUCTL_ ## pupd) + +/* A pin group number which is not used */ +#define PIN_RESERVED \ + PIN(NONE, NONE, NONE, NONE, NONE, NONE, NONE) + +const struct tegra_pingroup_desc tegra_soc_pingroups[PINGRP_COUNT ] = { +PIN (ATA ,NAND ,IDE ,NAND ,GMI ,RSVD ,IDE ), +PIN (ATB ,NAND ,IDE ,NAND ,GMI ,SDIO4 ,IDE ), +PIN (ATC ,NAND ,IDE ,NAND ,GMI ,SDIO4 ,IDE ), +PIN (ATD ,NAND ,IDE ,NAND ,GMI ,SDIO4 ,IDE ), +PIN (CDEV1 ,AUDIO ,OSC ,PLLA_OUT ,PLLM_OUT1 ,AUDIO_SYNC ,OSC ), +PIN (CDEV2 ,AUDIO ,OSC ,AHB_CLK ,APB_CLK ,PLLP_OUT4 ,OSC ), +PIN (CSUS ,VI ,PLLC_OUT1 ,PLLP_OUT2 ,PLLP_OUT3 ,VI_SENSOR_CLK , +PLLC_OUT1 ), +PIN (DAP1 ,AUDIO ,DAP1 ,RSVD ,GMI ,SDIO2 ,DAP1 ), + +PIN (DAP2 ,AUDIO ,DAP2 ,TWC ,RSVD ,GMI ,DAP2 ), +PIN (DAP3 ,BB ,DAP3 ,RSVD ,RSVD ,RSVD ,DA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SVD4 ), +PIN (UAD ,UART ,IRDA ,SPDIF ,UARTA ,SPI4 ,SPDIF ), +PIN (UCA ,UART ,UARTC ,RSVD ,GMI ,RSVD ,RSVD4 ), +PIN (UCB ,UART ,UARTC ,PWM ,GMI ,RSVD ,RSVD4 ), + +PIN_RESERVED , +PIN (ATE ,NAND ,IDE ,NAND ,GMI ,RSVD ,IDE ), +PIN (KBCC ,SYS ,KBC ,NAND ,TRACE ,EMC_TEST1_DLL ,KBC ), +PIN_RESERVED , +PIN_RESERVED , +PIN (GMB ,NAND ,IDE ,NAND ,GMI ,GMI_INT ,GMI ), +PIN (GMD ,NAND ,RSVD ,NAND ,GMI ,SFLASH ,GMI ), +PIN (DDC ,LCD ,I2C2 ,RSVD ,RSVD ,RSVD ,RSVD4 ), + +/* 64 */ +PINP (LD0 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD1 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD2 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD3 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD4 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD5 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD6 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD7 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), + +PINP (LD8 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD9 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD10 ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LD17 ), +PINP (LD11 ,LCD ,DISPA ,DISPB ,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,RSVD4 ,LS ), +PINP (LCSN ,LCD ,DISPA ,DISPB ,SPI3 ,RSVD ,RSVD4 ,LS ), + +/* 96 */ +PINP (LSPI ,LCD ,DISPA ,DISPB ,XIO ,HDMI ,DISPA ,LC ), +PINP (LSDA ,LCD ,DISPA ,DISPB ,SPI3 ,HDMI ,DISPA ,LS ), +PINP (LSDI ,LCD ,DISPA ,DISPB ,SPI3 ,RSVD ,DISPA ,LS ), +PINP (LPW0 ,LCD ,DISPA ,DISPB ,SPI3 ,HDMI ,DISPA ,LS ), +PINP (LPW1 ,LCD ,DISPA ,DISPB ,RSVD ,RSVD ,RSVD4 ,LS ), +PINP (LPW2 ,LCD ,DISPA ,DISPB ,SPI3 ,HDMI ,DISPA ,LS ), +PINP (LDI ,LCD ,DISPA ,DISPB ,RSVD ,RSVD ,RSVD4 ,LD23_22 ), +PINP (LHS ,LCD ,DISPA ,DISPB ,XIO ,RSVD ,RSVD4 ,LC ), + +PINP (LPP ,LCD ,DISPA ,DISPB ,RSVD ,RSVD ,RSVD4 ,LD23_22 ), +PIN_RESERVED , +PIN (KBCD ,SYS ,KBC ,NAND ,SDIO2 ,MIO ,KBC ), +PIN (GPU7 ,SYS ,RTCK ,RSVD ,RSVD ,RSVD ,RTCK ), +PIN (DTF ,VI ,I2C3 ,RSVD ,VI ,RSVD ,RSVD4 ), +PIN (UDA ,BB ,SPI1 ,RSVD ,UARTD ,ULPI ,RSVD2 ), +PIN (CRTP ,LCD ,CRT ,RSVD ,RSVD ,RSVD ,RSVD ), +PINP (SDB ,SD ,UARTA ,PWM ,SDIO3 ,SPI2 ,PWM ,NONE ), + +/* these pin groups only have pullup and pull down control */ +PINALL (CK32 ,SYS ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +PINALL (DDRC ,DDR ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +PINALL (PMCA ,SYS ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +PINALL (PMCB ,SYS ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +PINALL (PMCC ,SYS ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +PINALL (PMCD ,SYS ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +PINALL (PMCE ,SYS ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +PINALL (XM2C ,DDR ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +PINALL (XM2D ,DDR ,RSVD ,RSVD ,RSVD ,RSVD ,RSVD ,MUXCTL_NONE , +PUCTL_NONE ), +}; +void pinmux_set_tristate (enum pmux_pingrp pin,int enable) { -struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE ; +struct pmux_tri_ctlr *pmt = + (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE ;u32 *tri = &pmt->pmt_tri[TRISTATE_REG (pin)];u32 reg;
@@ -50,3 +504,69 @@ void pinmux_tristate_disable(enum pmux_pingrp pin) {pinmux_set_tristate (pin,0 ); } + +void pinmux_set_pullupdown (enum pmux_pingrp pin,enum pmux_pull pupd) +{ +struct pmux_tri_ctlr *pmt = + (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE ; +enum pmux_pullid pull_id = tegra_soc_pingroups[pin].pull_id; +u32 *pull = &pmt->pmt_pull[PULL_REG (pull_id)]; +u32 mask_bit; +u32 reg; + mask_bit =PULL_SHIFT (pull_id); + + reg =readl (pull); + reg &= ~(0x3 << mask_bit); + reg |= pupd << mask_bit; +writel (reg, pull); +} + +void pinmux_set_func (enum pmux_pingrp pin,enum pmux_func func) +{ +struct pmux_tri_ctlr *pmt = + (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE ; +enum pmux_ctlid mux_id = tegra_soc_pingroups[pin].ctl_id; +u32 *muxctl = &pmt->pmt_ctl[MUXCTL_REG (mux_id)]; +u32 mask_bit; +int i, mux =-1 ; +u32 reg; + +assert (pmux_func_isvalid (func)); + +/* Handle special values */ +if (func >=PMUX_FUNC_RSVD1 ) { + mux = (func -PMUX_FUNC_RSVD1 ) &0x3 ; + }else { +/* Search for the appropriate function */ +for (i =0 ; i <4 ; i++) { +if (tegra_soc_pingroups[pin].funcs[i] == func) { + mux = i; +break ; + } + } + } +assert (mux !=-1 ); + + mask_bit =MUXCTL_SHIFT (mux_id); + reg =readl (muxctl); + reg &= ~(0x3 << mask_bit); + reg |= mux << mask_bit; +writel (reg, muxctl); +} + +void pinmux_config_pingroup (struct pingroup_config *config) +{ +enum pmux_pingrp pin = config->pingroup; + +pinmux_set_func (pin, config->func); +pinmux_set_pullupdown (pin, config->pull); +pinmux_set_tristate (pin, config->tristate); +} + +void pinmux_config_table (struct pingroup_config *config,int len) +{ +int i; + +for (i =0 ; i < len; i++) +pinmux_config_pingroup (&config[i]); +}
arch/arm/include/asm/arch-tegra2/pinmux.h +175 -17
223 lines not on this page · raw message
board/nvidia/common/board.c +11 -31
65 lines not on this page · raw message
Signature · 1 line
1.7.3.1
PATCH v2 6/6 tegra2: Enable MMC for Seaboard
In reply to Simon GlassFrom: Tom Warren <[email protected]>
This adds the required GPIO and pinmux configuration to make eMMC / SD work on Seaboard.
--- board/nvidia/common/board.c | 13 +------------ board/nvidia/common/board.h | 1 + board/nvidia/harmony/harmony.c | 26 ++++++++++++++++++++++++++ board/nvidia/seaboard/seaboard.c | 35 ++++++++++++++++++++++++++++++++++- drivers/mmc/tegra2_mmc.c | 2 +- 5 files changed, 63 insertions(+), 14 deletions(-)
board/nvidia/common/board.c +1 -12
@@ -160,6 +160,7 @@ int board_mmc_init(bd_t *bd)/* Enable clocks, muxes, etc. for SDMMC controllers */ clock_init_mmc ();pin_mux_mmc (); +gpio_config_mmc ();debug ("board_mmc_init: init eMMC\n" );/* init dev 0, eMMC chip, with 4-bit bus */
@@ -171,18 +172,6 @@ int board_mmc_init(bd_t *bd) return 0; } - -/* this is a weak define that we are overriding */ -int board_mmc_getcd (u8 *cd,struct mmc *mmc) -{ -debug ("board_mmc_getcd called\n" ); -/* -* Hard-code CD presence for now. Need to add GPIO inputs -* for Seaboard & Harmony (& Kaen/Aebl/Wario?) -*/ - *cd =1 ; -return 0 ; -}#endif #ifdef CONFIG_BOARD_EARLY_INIT_F
board/nvidia/common/board.h +1 -0
@@ -26,6 +26,7 @@void tegra2_start (void );void gpio_config_uart (void ); +void gpio_config_mmc (void );int tegra2_mmc_init (int dev_index,int bus_width);#endif /* BOARD_H */
board/nvidia/harmony/harmony.c +26 -0
@@ -24,6 +24,9 @@#include <common.h> #include <asm/io.h> #include <asm/arch/tegra2.h> +#ifdef CONFIG_TEGRA2_MMC +#include <mmc.h> +#endif /* * Routine: gpio_config_uart
@@ -32,3 +35,26 @@void gpio_config_uart (void ) { } + +#ifdef CONFIG_TEGRA2_MMC +/* +* Routine: gpio_config_mmc +* Description: Set GPIOs for SD card +*/ +void gpio_config_mmc (void ) +{ +/* Not implemented for now */ +} + +/* this is a weak define that we are overriding */ +int board_mmc_getcd (u8 *cd,struct mmc *mmc) +{ +debug ("board_mmc_getcd called\n" ); +/* +* Hard-code CD presence for now. Need to add GPIO inputs +* for Harmony +*/ + *cd =1 ; +return 0 ; +} +#endif
board/nvidia/seaboard/seaboard.c +34 -1
@@ -24,7 +24,10 @@#include <common.h> #include <asm/io.h> #include <asm/arch/tegra2.h> -#include <asm/arch/gpio.h> +#include <asm/gpio.h> +#ifdef CONFIG_TEGRA2_MMC +#include <mmc.h> +#endif /* * Routine: gpio_config_uart
@@ -50,3 +53,33 @@ void gpio_config_uart(void) val |=1 <<GPIO_BIT (gp);writel (val, &bank->gpio_dir_out[GPIO_PORT (gp)]); } + +#ifdef CONFIG_TEGRA2_MMC +/* +* Routine: gpio_config_mmc +* Description: Set GPIOs for SDMMC3 SDIO slot. +*/ +void gpio_config_mmc (void ) +{ +/* Set EN_VDDIO_SD (GPIO I6) */ +gpio_direction_output (GPIO_PI6 ,1 ); + +/* Config pin as GPI for Card Detect (GPIO I5) */ +gpio_direction_input (GPIO_PI5 ); +} + +/* this is a weak define that we are overriding */ +int board_mmc_getcd (u8 *cd,struct mmc *mmc) +{ +debug ("board_mmc_getcd called\n" ); + *cd =1 ;/* Assume card is inserted, or eMMC */ + +if (IS_SD (mmc)) { +/* Seaboard SDMMC3 = SDIO3_CD = GPIO_PI5 */ +if (gpio_get_value (GPIO_PI5 )) + *cd =0 ; + } + +return 0 ; +} +#endif
drivers/mmc/tegra2_mmc.c +1 -1
@@ -452,7 +452,7 @@ static int tegra2_mmc_initialize(int dev_index, int bus_width) mmc->host_caps =MMC_MODE_8BIT ; else mmc->host_caps = MMC_MODE_4BIT; - mmc->host_caps |= MMC_MODE_HS_52MHz |MMC_MODE_HS ; + mmc->host_caps |= MMC_MODE_HS_52MHz |MMC_MODE_HS |MMC_MODE_HC ;/* * min freq is for card identification, and is the highest
Signature · 1 line
1.7.3.1
v2 cover tegra2: Add more clock/pinmux functionality
In reply to Simon GlassHi Albert,
Quoted 28 lines · Simon Glass
This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID.
Functions are provided to start, query and adjust peripheral clocks, including automatic selection of the best available clock based on the requested rate (this replaces hard-coded divisors).
On the pinmux side we can now select functions for pin groups using the new
pinmux_set_func()function.Expanded functions are provided to adjust and query PLL clocks.
With a full compliment of clock and pinmux functions, it should no longer be necessary for board/driver code to directly access clock registers. This change removes all such accesses.
This functionality will be used for I2C, SPI, LCD, USB, keyboard, NAND and other drivers for Tegra2.
At then end is a patch to enable MMC on Seaboard, to make it all worthwhile.
Note: These patches include a definition of
assert()which I will happily remove if the one sent upstream is accepted.Changes in v2:
- Removeassert()which is now incommon.h
Quoted 7 lines
Simon Glass (6):
?tegra2: RenameCLOCK_PLL_IDtoCLOCK_ID
?tegra2: Clean up board code a little
?tegra2: Add more clock functions
?tegra2: RenamePIN_toPINGRP_
?tegra2: Add more pinmux functions
?tegra2: Enable MMC for Seaboard
Are these ready to apply, do you think?
Regards,
Simon
Quoted 19 lines
?arch/arm/cpu/armv7/tegra2/ap20.c ? ? ? ? ? | ? ?5 +- ?arch/arm/cpu/armv7/tegra2/clock.c ? ? ? ? ?| ?825 +++++++++++++++++++++++++++- ?arch/arm/cpu/armv7/tegra2/pinmux.c ? ? ? ? | ?528 ++++++++++++++++++- ?arch/arm/include/asm/arch-tegra2/clk_rst.h | ? 84 +-- ?arch/arm/include/asm/arch-tegra2/clock.h ? | ?149 ++++- ?arch/arm/include/asm/arch-tegra2/pinmux.h ?| ?444 ++++++++++----- ?board/nvidia/common/board.c ? ? ? ? ? ? ? ?| ?243 +++------ ?board/nvidia/common/board.h ? ? ? ? ? ? ? ?| ? ?4 +- ?board/nvidia/harmony/harmony.c ? ? ? ? ? ? | ? 26 + ?board/nvidia/seaboard/seaboard.c ? ? ? ? ? | ? 35 ++- ?drivers/mmc/tegra2_mmc.c ? ? ? ? ? ? ? ? ? | ? 94 ++-- ?drivers/mmc/tegra2_mmc.h ? ? ? ? ? ? ? ? ? | ? ?1 +?12 files changed, 1950 insertions(+), 488 deletions(-)
--
1.7.3.1
v2 cover tegra2: Add more clock/pinmux functionality
Hi Simon,
Quoted 39 lines · Simon Glass
Hi Albert,
Quoted 28 lines · Simon Glass
This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID.
Functions are provided to start, query and adjust peripheral clocks, including automatic selection of the best available clock based on the requested rate (this replaces hard-coded divisors).
On the pinmux side we can now select functions for pin groups using the new
pinmux_set_func()function.Expanded functions are provided to adjust and query PLL clocks.
With a full compliment of clock and pinmux functions, it should no longer be necessary for board/driver code to directly access clock registers. This change removes all such accesses.
This functionality will be used for I2C, SPI, LCD, USB, keyboard, NAND and other drivers for Tegra2.
At then end is a patch to enable MMC on Seaboard, to make it all worthwhile.
Note: These patches include a definition of
assert()which I will happily remove if the one sent upstream is accepted.Changes in v2:
- Removeassert()which is now incommon.hQuoted 7 lines
Simon Glass (6):
tegra2: RenameCLOCK_PLL_IDtoCLOCK_ID
tegra2: Clean up board code a little
tegra2: Add more clock functions
tegra2: RenamePIN_toPINGRP_
tegra2: Add more pinmux functions
tegra2: Enable MMC for Seaboard
Quoted 1 line
Are these ready to apply, do you think?
They would appear to. Only these are not bug fixes, and so close to a release, I am going to add them in /next, not /master.
Quoted 2 lines
Regards,
Simon
Amicalement,
Signature · 1 line
Albert.
v2 cover tegra2: Add more clock/pinmux functionality
Hi Albert,
Quoted 47 lines · Albert ARIBAUD
Hi Simon,
Quoted 44 lines · Simon Glass
Hi Albert,
Quoted 39 lines · On Wed, Sep 21, 2011 at 3:40 PM, Simon Glass<[email protected]> ?wrote:
This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID.
Functions are provided to start, query and adjust peripheral clocks, including automatic selection of the best available clock based on the requested rate (this replaces hard-coded divisors).
On the pinmux side we can now select functions for pin groups using the new
pinmux_set_func()function.Expanded functions are provided to adjust and query PLL clocks.
With a full compliment of clock and pinmux functions, it should no longer be necessary for board/driver code to directly access clock registers. This
change removes all such accesses.This functionality will be used for I2C, SPI, LCD, USB, keyboard, NAND and
other drivers for Tegra2.At then end is a patch to enable MMC on Seaboard, to make it all worthwhile.
Note: These patches include a definition of
assert()which I will happily remove if the one sent upstream is accepted.Changes in v2:
- Removeassert()which is now incommon.hSimon Glass (6):
?tegra2: RenameCLOCK_PLL_IDtoCLOCK_ID
?tegra2: Clean up board code a little
?tegra2: Add more clock functions
?tegra2: RenamePIN_toPINGRP_
?tegra2: Add more pinmux functions
?tegra2: Enable MMC for Seaboard
Quoted 4 lines
Quoted 1 line
Are these ready to apply, do you think?
They would appear to. Only these are not bug fixes, and so close to a release, I am going to add them in /next, not /master.
Yes, definitely /next, thanks.
Regards,
Simon
Quoted 8 lines
Quoted 3 lines
Regards,
SimonAmicalement,
--
Albert.
v2 cover tegra2: Add more clock/pinmux functionality
Hi Albert,
Quoted 51 lines · Simon Glass
Hi Albert,
Quoted 47 lines · Albert ARIBAUD
Hi Simon,
Quoted 44 lines · Simon Glass
Hi Albert,
Quoted 39 lines · On Wed, Sep 21, 2011 at 3:40 PM, Simon Glass<[email protected]> ?wrote:
This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID.
Functions are provided to start, query and adjust peripheral clocks, including automatic selection of the best available clock based on the requested rate (this replaces hard-coded divisors).
On the pinmux side we can now select functions for pin groups using the new
pinmux_set_func()function.Expanded functions are provided to adjust and query PLL clocks.
With a full compliment of clock and pinmux functions, it should no longer be necessary for board/driver code to directly access clock registers. This
change removes all such accesses.This functionality will be used for I2C, SPI, LCD, USB, keyboard, NAND and
other drivers for Tegra2.At then end is a patch to enable MMC on Seaboard, to make it all worthwhile.
Note: These patches include a definition of
assert()which I will happily remove if the one sent upstream is accepted.Changes in v2:
- Removeassert()which is now incommon.hSimon Glass (6):
?tegra2: RenameCLOCK_PLL_IDtoCLOCK_ID
?tegra2: Clean up board code a little
?tegra2: Add more clock functions
?tegra2: RenamePIN_toPINGRP_
?tegra2: Add more pinmux functions
?tegra2: Enable MMC for Seaboard
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Are these ready to apply, do you think?
They would appear to. Only these are not bug fixes, and so close to a release, I am going to add them in /next, not /master.
Yes, definitely /next, thanks.
Now that the release is over, is it possible to get these applied please?
Regards,
Simon
v2 cover tegra2: Add more clock/pinmux functionality
In reply to Simon GlassHi Simon,
Le 22/09/2011 00:40, Simon Glass a ?crit :
Quoted 20 lines
This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID.
Functions are provided to start, query and adjust peripheral clocks, including automatic selection of the best available clock based on the requested rate (this replaces hard-coded divisors).
On the pinmux side we can now select functions for pin groups using the new
pinmux_set_func()function.Expanded functions are provided to adjust and query PLL clocks.
With a full compliment of clock and pinmux functions, it should no longer be necessary for board/driver code to directly access clock registers. This change removes all such accesses.
This functionality will be used for I2C, SPI, LCD, USB, keyboard, NAND and other drivers for Tegra2.
Quoted 7 lines
At then end is a patch to enable MMC on Seaboard, to make it all worthwhile.
Note: These patches include a definition of
assert()which I will happily remove if the one sent upstream is accepted.Changes in v2:
- Removeassert()which is now incommon.h
Series applied to u-boot-arm/master, thanks!
Amicalement,
Signature · 1 line
Albert.
v2 cover tegra2: Add more clock/pinmux functionality
Hi Albert,
Quoted 28 lines · Albert ARIBAUD
Hi Simon,
Le 22/09/2011 00:40, Simon Glass a ?crit :
Quoted 25 lines
This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID.
Functions are provided to start, query and adjust peripheral clocks, including automatic selection of the best available clock based on the requested rate (this replaces hard-coded divisors).
On the pinmux side we can now select functions for pin groups using the new
pinmux_set_func()function.Expanded functions are provided to adjust and query PLL clocks.
With a full compliment of clock and pinmux functions, it should no longer be necessary for board/driver code to directly access clock registers. This
change removes all such accesses.This functionality will be used for I2C, SPI, LCD, USB, keyboard, NAND and other drivers for Tegra2.
At then end is a patch to enable MMC on Seaboard, to make it all worthwhile.
Quoted 7 lines
Quoted 5 lines
Note: These patches include a definition of
assert()which I will happily remove if the one sent upstream is accepted.Changes in v2:
- Removeassert()which is now incommon.hSeries applied to u-boot-arm/master, thanks!
Thank you Albert. Will work on the next series now.
Regards,
Simon
Quoted 5 lines
Amicalement,
--
Albert.
v2 cover tegra2: Add more clock/pinmux functionality
In reply to Albert ARIBAUDAlbert ARIBAUD wrote at Tuesday, October 11, 2011 2:12 PM:
Quoted 4 lines
Le 22/09/2011 00:40, Simon Glass a ?crit :
Quoted 3 lines
This adds to the basic clock functionality already available. The concept of a peripheral ID is introduced, and all peripheral clock access is done using this ID.
...
Quoted 1 line
Series applied to u-boot-arm/master, thanks!
Albert,
I'm working on some Tegra board/SDHCI-driver patches that build on those patches (I've already posted them here). Once they're accepted, I assume they would go into this same repo/branch, such that I don't need to mention anything in particular about dependencies?
Is there a uboot-next branch anywhere, like linux-next, or should I work off u-boot-arm/master rather than the main U-Boot master branch?
Thanks.
Signature · 1 line
nvpublic