diff options
author | John Crispin <john@openwrt.org> | 2007-12-14 21:49:03 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2007-12-14 21:49:03 +0000 |
commit | 54968fdf1da7e86cbbd192a02b96762f75786204 (patch) | |
tree | 3b1ae7738801f3144729b9b43d357ac7fe95005b /target/linux/danube/files/drivers | |
parent | e052bd9a18b6047d03eb377e340432f691bada86 (diff) | |
download | upstream-54968fdf1da7e86cbbd192a02b96762f75786204.tar.gz upstream-54968fdf1da7e86cbbd192a02b96762f75786204.tar.bz2 upstream-54968fdf1da7e86cbbd192a02b96762f75786204.zip |
made the danube pmu f00 generic
SVN-Revision: 9759
Diffstat (limited to 'target/linux/danube/files/drivers')
-rw-r--r-- | target/linux/danube/files/drivers/char/danube_led.c | 22 | ||||
-rw-r--r-- | target/linux/danube/files/drivers/net/danube_mii0.c | 6 |
2 files changed, 5 insertions, 23 deletions
diff --git a/target/linux/danube/files/drivers/char/danube_led.c b/target/linux/danube/files/drivers/char/danube_led.c index 38ac4c1708..86a92d5999 100644 --- a/target/linux/danube/files/drivers/char/danube_led.c +++ b/target/linux/danube/files/drivers/char/danube_led.c @@ -29,7 +29,7 @@ #include <linux/errno.h> #include <asm/danube/danube.h> #include <asm/danube/danube_gpio.h> -#include <asm/delay.h> +#include <asm/danube/danube_pmu.h> #define DANUBE_LED_CLK_EDGE DANUBE_LED_FALLING //#define DANUBE_LED_CLK_EDGE DANUBE_LED_RISING @@ -87,24 +87,6 @@ danube_led_setup_gpio (void) } } -static void -danube_led_enable (void) -{ - int err = 1000000; - - writel(readl(DANUBE_PMU_PWDCR) & ~DANUBE_PMU_PWDCR_LED, DANUBE_PMU_PWDCR); - while (--err && (readl(DANUBE_PMU_PWDSR) & DANUBE_PMU_PWDCR_LED)) {} - - if (!err) - panic("Activating LED in PMU failed!"); -} - -static inline void -danube_led_disable (void) -{ - writel(readl(DANUBE_PMU_PWDCR) | DANUBE_PMU_PWDCR_LED, DANUBE_PMU_PWDCR); -} - static int led_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -187,7 +169,7 @@ danube_led_init (void) writel(readl(DANUBE_LED_CON0) | DANUBE_LED_ADSL_SRC, DANUBE_LED_CON0); /* per default, the leds are turned on */ - danube_led_enable(); + danube_pmu_enable(DANUBE_PMU_PWDCR_LED); danube_led_major = register_chrdev(0, "danube_led", &danube_led_fops); diff --git a/target/linux/danube/files/drivers/net/danube_mii0.c b/target/linux/danube/files/drivers/net/danube_mii0.c index 63a7febbf6..354ccc36d1 100644 --- a/target/linux/danube/files/drivers/net/danube_mii0.c +++ b/target/linux/danube/files/drivers/net/danube_mii0.c @@ -44,6 +44,7 @@ #include <asm/danube/danube.h> #include <asm/danube/danube_mii0.h> #include <asm/danube/danube_dma.h> +#include <asm/danube/danube_pmu.h> static struct net_device danube_mii0_dev; static unsigned char u_boot_ethaddr[MAX_ADDR_LEN]; @@ -372,9 +373,8 @@ switch_init (struct net_device *dev) static void danube_sw_chip_init (int mode) { - writel(readl(DANUBE_PMU_PWDCR) & ~DANUBE_PMU_PWDCR_DMA, DANUBE_PMU_PWDCR); - writel(readl(DANUBE_PMU_PWDCR) & ~DANUBE_PMU_PWDCR_PPE, DANUBE_PMU_PWDCR); - wmb(); + danube_pmu_enable(DANUBE_PMU_PWDCR_DMA); + danube_pmu_enable(DANUBE_PMU_PWDCR_PPE); if(mode == REV_MII_MODE) writel((readl(DANUBE_PPE32_CFG) & PPE32_MII_MASK) | PPE32_MII_REVERSE, DANUBE_PPE32_CFG); |