diff options
author | kaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-05-20 19:32:31 +0000 |
---|---|---|
committer | kaloz <kaloz@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-05-20 19:32:31 +0000 |
commit | c4105c81c08ae5ec786cc81dc005f2aa58afa751 (patch) | |
tree | 33ae0f34faeec519406a89f969c617455db33a61 /target/linux/aruba-2.6/files/arch/mips/aruba/flash_lock.c | |
parent | f2146ff453e3276df5dd8cdf4306409083ce110c (diff) |
convert aruba to the new structure
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7284 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/aruba-2.6/files/arch/mips/aruba/flash_lock.c')
-rw-r--r-- | target/linux/aruba-2.6/files/arch/mips/aruba/flash_lock.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/aruba-2.6/files/arch/mips/aruba/flash_lock.c b/target/linux/aruba-2.6/files/arch/mips/aruba/flash_lock.c new file mode 100644 index 000000000..48c762db5 --- /dev/null +++ b/target/linux/aruba-2.6/files/arch/mips/aruba/flash_lock.c @@ -0,0 +1,27 @@ +#include <linux/module.h> +#include <linux/types.h> +#include <asm/bootinfo.h> + +#define AP70_PROT_ADDR 0xb8010008 +#define AP70_PROT_DATA 0x8 +#define AP60_PROT_ADDR 0xB8400000 +#define AP60_PROT_DATA 0x04000000 + +void unlock_ap60_70_flash(void) +{ + volatile __u32 val; + switch (mips_machtype) { + case MACH_ARUBA_AP70: + val = *(volatile __u32 *)AP70_PROT_ADDR; + val &= ~(AP70_PROT_DATA); + *(volatile __u32 *)AP70_PROT_ADDR = val; + break; + case MACH_ARUBA_AP65: + case MACH_ARUBA_AP60: + default: + val = *(volatile __u32 *)AP60_PROT_ADDR; + val &= ~(AP60_PROT_DATA); + *(volatile __u32 *)AP60_PROT_ADDR = val; + break; + } +} |