| 1 | From 0fec0136456ce214ea4df6b8ff3b3728befc816a Mon Sep 17 00:00:00 2001 |
| 2 | From: Florian Fainelli <florian@openwrt.org> |
| 3 | Date: Tue, 31 Jan 2012 15:12:22 +0100 |
| 4 | Subject: [PATCH 3/6] MIPS: BCM63XX: add support for "ipsec" clock |
| 5 | |
| 6 | This module is only available on BCM6368 so far and does not require |
| 7 | resetting the block. |
| 8 | |
| 9 | Signed-off-by: Florian Fainelli <florian@openwrt.org> |
| 10 | Cc: linux-mips@linux-mips.org |
| 11 | Cc: mpm@selenic.com |
| 12 | Cc: herbert@gondor.apana.org.au |
| 13 | Patchwork: https://patchwork.linux-mips.org/patch/3324/ |
| 14 | Signed-off-by: Ralf Baechle <ralf@linux-mips.org> |
| 15 | --- |
| 16 | arch/mips/bcm63xx/clk.c | 14 ++++++++++++++ |
| 17 | 1 files changed, 14 insertions(+), 0 deletions(-) |
| 18 | |
| 19 | --- a/arch/mips/bcm63xx/clk.c |
| 20 | +++ b/arch/mips/bcm63xx/clk.c |
| 21 | @@ -224,6 +224,18 @@ static struct clk clk_xtm = { |
| 22 | }; |
| 23 | |
| 24 | /* |
| 25 | + * IPsec clock |
| 26 | + */ |
| 27 | +static void ipsec_set(struct clk *clk, int enable) |
| 28 | +{ |
| 29 | + bcm_hwclock_set(CKCTL_6368_IPSEC_EN, enable); |
| 30 | +} |
| 31 | + |
| 32 | +static struct clk clk_ipsec = { |
| 33 | + .set = ipsec_set, |
| 34 | +}; |
| 35 | + |
| 36 | +/* |
| 37 | * Internal peripheral clock |
| 38 | */ |
| 39 | static struct clk clk_periph = { |
| 40 | @@ -280,6 +292,8 @@ struct clk *clk_get(struct device *dev, |
| 41 | return &clk_periph; |
| 42 | if (BCMCPU_IS_6358() && !strcmp(id, "pcm")) |
| 43 | return &clk_pcm; |
| 44 | + if (BCMCPU_IS_6368() && !strcmp(id, "ipsec")) |
| 45 | + return &clk_ipsec; |
| 46 | return ERR_PTR(-ENOENT); |
| 47 | } |
| 48 | |
| 49 | |