diff options
| author | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-04 05:03:57 -0400 |
|---|---|---|
| committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2010-08-04 07:02:37 -0400 |
| commit | 0c07d3abc8d76120317c108062cc7aa81fbd96d6 (patch) | |
| tree | 3ba62b6532bd8388651405847cce91cf3112b300 | |
| parent | 6f09963caf5ff7cb4b8de600caee3ff016e97139 (diff) | |
CRIS: Better handling of pinmux settings
Depending on eth, eth_mido and geth fields in wr_hwprot, don't set
corresponding pins on gpio port b to gpio mode. This avoids
re-resetting the ethernet PHY should this already have been done.
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
| -rw-r--r-- | arch/cris/include/arch-v32/mach-a3/mach/startup.inc | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/arch/cris/include/arch-v32/mach-a3/mach/startup.inc b/arch/cris/include/arch-v32/mach-a3/mach/startup.inc index 2f23e5e16f4a..2d52bcc96ed5 100644 --- a/arch/cris/include/arch-v32/mach-a3/mach/startup.inc +++ b/arch/cris/include/arch-v32/mach-a3/mach/startup.inc | |||
| @@ -1,9 +1,19 @@ | |||
| 1 | #ifndef STARTUP_INC_INCLUDED | ||
| 2 | #define STARTUP_INC_INCLUDED | ||
| 3 | |||
| 1 | #include <hwregs/asm/reg_map_asm.h> | 4 | #include <hwregs/asm/reg_map_asm.h> |
| 2 | #include <hwregs/asm/gio_defs_asm.h> | 5 | #include <hwregs/asm/gio_defs_asm.h> |
| 3 | #include <hwregs/asm/pio_defs_asm.h> | 6 | #include <hwregs/asm/pio_defs_asm.h> |
| 4 | #include <hwregs/asm/clkgen_defs_asm.h> | 7 | #include <hwregs/asm/clkgen_defs_asm.h> |
| 5 | #include <hwregs/asm/pinmux_defs_asm.h> | 8 | #include <hwregs/asm/pinmux_defs_asm.h> |
| 6 | 9 | ||
| 10 | .macro GIO_SET_P BITS, OUTREG | ||
| 11 | bmi 1f ; btstq: bit -> N flag | ||
| 12 | nop | ||
| 13 | or.d \BITS, \OUTREG | ||
| 14 | 1: | ||
| 15 | .endm | ||
| 16 | |||
| 7 | .macro GIO_INIT | 17 | .macro GIO_INIT |
| 8 | move.d CONFIG_ETRAX_DEF_GIO_PA_OUT, $r0 | 18 | move.d CONFIG_ETRAX_DEF_GIO_PA_OUT, $r0 |
| 9 | move.d REG_ADDR(gio, regi_gio, rw_pa_dout), $r1 | 19 | move.d REG_ADDR(gio, regi_gio, rw_pa_dout), $r1 |
| @@ -32,10 +42,23 @@ | |||
| 32 | move.d 0xFFFFFFFF, $r0 | 42 | move.d 0xFFFFFFFF, $r0 |
| 33 | move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pa), $r1 | 43 | move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pa), $r1 |
| 34 | move.d $r0, [$r1] | 44 | move.d $r0, [$r1] |
| 35 | move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pb), $r1 | ||
| 36 | move.d $r0, [$r1] | ||
| 37 | move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pc), $r1 | 45 | move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pc), $r1 |
| 38 | move.d $r0, [$r1] | 46 | move.d $r0, [$r1] |
| 47 | |||
| 48 | ;; If eth_mdio, eth, geth bits are set in hwprot, don't | ||
| 49 | ;; set them to gpio, as this means they have been configured | ||
| 50 | ;; earlier and shouldn't be changed. | ||
| 51 | move.d 0xFC000000, $r2 ; pins 25..0 are eth_mdio, eth, geth | ||
| 52 | move.d REG_ADDR(pinmux, regi_pinmux, rw_hwprot), $r1 | ||
| 53 | move.d [$r1], $r0 | ||
| 54 | btstq REG_BIT(pinmux, rw_hwprot, eth), $r0 | ||
| 55 | GIO_SET_P 0x00FFFF00, $r2 ;; pins 8..23 are eth | ||
| 56 | btstq REG_BIT(pinmux, rw_hwprot, eth_mdio), $r0 | ||
| 57 | GIO_SET_P 0x03000000, $r2 ;; pins 24..25 are eth_mdio | ||
| 58 | btstq REG_BIT(pinmux, rw_hwprot, geth), $r0 | ||
| 59 | GIO_SET_P 0x000000FF, $r2 ;; pins 0..7 are geth | ||
| 60 | move.d REG_ADDR(pinmux, regi_pinmux, rw_gio_pb), $r1 | ||
| 61 | move.d $r2, [$r1] | ||
| 39 | .endm | 62 | .endm |
| 40 | 63 | ||
| 41 | .macro START_CLOCKS | 64 | .macro START_CLOCKS |
| @@ -58,3 +81,4 @@ | |||
| 58 | move.d CONFIG_ETRAX_PIO_CE2_CFG, $r1 | 81 | move.d CONFIG_ETRAX_PIO_CE2_CFG, $r1 |
| 59 | move.d $r1, [$r0] | 82 | move.d $r1, [$r0] |
| 60 | .endm | 83 | .endm |
| 84 | #endif | ||
