From 82208ad62875c0e2c365d0ac481d699f138126f0 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:36 +0000 Subject: [PATCH] --- yaml --- r: 123863 b: refs/heads/master c: 3627379fc6b3e2b531b371af97d8ce0040fc3646 h: refs/heads/master i: 123861: 7edf411f65057d59ccd0efdcd5970e69b60dd8b0 123859: fe44fbd939a9fc786ccdae3dfe71b24574f62342 123855: d3db57bdcb2dbe88888208ba5f5051c8450d5f7f v: v3 --- [refs] | 2 +- trunk/arch/arm/plat-s3c64xx/clock.c | 22 +++++++++++++++++ .../arm/plat-s3c64xx/include/plat/regs-sys.h | 24 +++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 trunk/arch/arm/plat-s3c64xx/include/plat/regs-sys.h diff --git a/[refs] b/[refs] index 13d088a5bfa9..183a15d2dd71 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1451325ced5f9b1a3e5da07521deb049e32cb15a +refs/heads/master: 3627379fc6b3e2b531b371af97d8ce0040fc3646 diff --git a/trunk/arch/arm/plat-s3c64xx/clock.c b/trunk/arch/arm/plat-s3c64xx/clock.c index 2d2e83a036c4..523da0cb55c5 100644 --- a/trunk/arch/arm/plat-s3c64xx/clock.c +++ b/trunk/arch/arm/plat-s3c64xx/clock.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -33,10 +34,31 @@ struct clk clk_27m = { .rate = 27000000, }; +static int clk_48m_ctrl(struct clk *clk, int enable) +{ + unsigned long flags; + u32 val; + + /* can't rely on clock lock, this register has other usages */ + local_irq_save(flags); + + val = __raw_readl(S3C64XX_OTHERS); + if (enable) + val |= S3C64XX_OTHERS_USBMASK; + else + val &= ~S3C64XX_OTHERS_USBMASK; + + __raw_writel(val, S3C64XX_OTHERS); + local_irq_restore(flags); + + return 0; +} + struct clk clk_48m = { .name = "clk_48m", .id = -1, .rate = 48000000, + .enable = clk_48m_ctrl, }; static int inline s3c64xx_gate(void __iomem *reg, diff --git a/trunk/arch/arm/plat-s3c64xx/include/plat/regs-sys.h b/trunk/arch/arm/plat-s3c64xx/include/plat/regs-sys.h new file mode 100644 index 000000000000..d8ed82917096 --- /dev/null +++ b/trunk/arch/arm/plat-s3c64xx/include/plat/regs-sys.h @@ -0,0 +1,24 @@ +/* arch/arm/plat-s3c64xx/include/plat/regs-sys.h + * + * Copyright 2008 Openmoko, Inc. + * Copyright 2008 Simtec Electronics + * Ben Dooks + * http://armlinux.simtec.co.uk/ + * + * S3C64XX system register definitions + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#ifndef __PLAT_REGS_SYS_H +#define __PLAT_REGS_SYS_H __FILE__ + +#define S3C_SYSREG(x) (S3C_VA_SYS + (x)) + +#define S3C64XX_OTHERS S3C_SYSREG(0x900) + +#define S3C64XX_OTHERS_USBMASK (1 << 16) + +#endif /* _PLAT_REGS_SYS_H */