diff options
Diffstat (limited to 'target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/ar9/cgu.c')
-rw-r--r-- | target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/ar9/cgu.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/ar9/cgu.c b/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/ar9/cgu.c new file mode 100644 index 000000000..d69d2f0bf --- /dev/null +++ b/target/linux/ifxmips/files-2.6.33/arch/mips/ifxmips/ar9/cgu.c @@ -0,0 +1,38 @@ +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/version.h> +#include <linux/types.h> +#include <linux/fs.h> +#include <linux/miscdevice.h> +#include <linux/init.h> +#include <linux/uaccess.h> +#include <linux/unistd.h> +#include <linux/errno.h> + +#include <asm/irq.h> +#include <asm/div64.h> + +#include <ifxmips.h> +#include <ifxmips_cgu.h> + +void +cgu_setup_pci_clk(int external_clock) +{ + /* set clock to 33Mhz */ + ifxmips_w32(ifxmips_r32(IFXMIPS_CGU_IFCCR) & ~0xf00000, + IFXMIPS_CGU_IFCCR); + ifxmips_w32(ifxmips_r32(IFXMIPS_CGU_IFCCR) | 0x800000, + IFXMIPS_CGU_IFCCR); + if (external_clock) + { + ifxmips_w32(ifxmips_r32(IFXMIPS_CGU_IFCCR) & ~(1 << 16), + IFXMIPS_CGU_IFCCR); + ifxmips_w32((1 << 30), IFXMIPS_CGU_PCICR); + } else { + ifxmips_w32(ifxmips_r32(IFXMIPS_CGU_IFCCR) | (1 << 16), + IFXMIPS_CGU_IFCCR); + ifxmips_w32((1 << 31) | (1 << 30), IFXMIPS_CGU_PCICR); + } +} + + |