diff options
author | Valentin Longchamp <valentin.longchamp@keymile.com> | 2014-01-27 10:49:05 (GMT) |
---|---|---|
committer | York Sun <yorksun@freescale.com> | 2014-02-03 16:38:49 (GMT) |
commit | 87ea2c0ff345ad59280bdf4702c3450a81e3c265 (patch) | |
tree | d668395fba8abc9fa59f4ab3a43b1330b9dc7d55 /board/keymile/kmp204x/kmp204x.c | |
parent | dd21f09669ee65500f1f9bce5c4024cf817f3c79 (diff) | |
download | u-boot-87ea2c0ff345ad59280bdf4702c3450a81e3c265.tar.xz |
kmp204x: introduce QRIO GPIO functions
The QRIO GPIO functions can be of general interest. They are thus added
to a qrio.c and their prototype are available from kmp204x.h. The QRIO
prst function are also included in this file, as well as the functions
required for the I2C deblocking support (open-drain).
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
[York Sun: Remove extra blank line in board/keymile/kmp204x/qrio.c]
Signed-off-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'board/keymile/kmp204x/kmp204x.c')
-rw-r--r-- | board/keymile/kmp204x/kmp204x.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c index 20a3264..bbb2453 100644 --- a/board/keymile/kmp204x/kmp204x.c +++ b/board/keymile/kmp204x/kmp204x.c @@ -77,62 +77,6 @@ unsigned long get_board_sys_clk(unsigned long dummy) return 66666666; } -#define WDMASK_OFF 0x16 - -static void qrio_wdmask(u8 bit, bool wden) -{ - u16 wdmask; - void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE; - - wdmask = in_be16(qrio_base + WDMASK_OFF); - - if (wden) - wdmask |= (1 << bit); - else - wdmask &= ~(1 << bit); - - out_be16(qrio_base + WDMASK_OFF, wdmask); -} - -#define PRST_OFF 0x1a - -void qrio_prst(u8 bit, bool en, bool wden) -{ - u16 prst; - void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE; - - qrio_wdmask(bit, wden); - - prst = in_be16(qrio_base + PRST_OFF); - - if (en) - prst &= ~(1 << bit); - else - prst |= (1 << bit); - - out_be16(qrio_base + PRST_OFF, prst); -} - -#define PRSTCFG_OFF 0x1c - -void qrio_prstcfg(u8 bit, u8 mode) -{ - u32 prstcfg; - u8 i; - void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE; - - prstcfg = in_be32(qrio_base + PRSTCFG_OFF); - - for (i = 0; i < 2; i++) { - if (mode & (1<<i)) - set_bit(2*bit+i, &prstcfg); - else - clear_bit(2*bit+i, &prstcfg); - } - - out_be32(qrio_base + PRSTCFG_OFF, prstcfg); -} - #define NUM_SRDS_BANKS 2 #define PHY_RST 15 |