diff options
Diffstat (limited to 'arch/blackfin/mach-bf527')
-rw-r--r-- | arch/blackfin/mach-bf527/Makefile | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezkit.c | 36 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/cpu.c | 161 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/dma.c | 5 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/head.S | 18 |
5 files changed, 37 insertions, 185 deletions
diff --git a/arch/blackfin/mach-bf527/Makefile b/arch/blackfin/mach-bf527/Makefile index 9f99f5d0bcd1..4eddb580319c 100644 --- a/arch/blackfin/mach-bf527/Makefile +++ b/arch/blackfin/mach-bf527/Makefile @@ -5,5 +5,3 @@ extra-y := head.o obj-y := ints-priority.o dma.o - -obj-$(CONFIG_CPU_FREQ) += cpu.o diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c index cf4bc0d83355..583d53811f03 100644 --- a/arch/blackfin/mach-bf527/boards/ezkit.c +++ b/arch/blackfin/mach-bf527/boards/ezkit.c @@ -94,7 +94,7 @@ int __init bfin_isp1761_init(void) { unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices); - printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); + printk(KERN_INFO "%s(): registering device resources\n", __func__); set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING); return platform_add_devices(bfin_isp1761_devices, num_devices); @@ -416,7 +416,7 @@ static struct platform_device net2272_bfin_device = { static struct mtd_partition bfin_spi_flash_partitions[] = { { .name = "bootloader", - .size = 0x00020000, + .size = 0x00040000, .offset = 0, .mask_flags = MTD_CAP_ROM }, { @@ -707,6 +707,32 @@ static struct platform_device bfin_uart_device = { }; #endif +#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) +static struct resource bfin_sir_resources[] = { +#ifdef CONFIG_BFIN_SIR0 + { + .start = 0xFFC00400, + .end = 0xFFC004FF, + .flags = IORESOURCE_MEM, + }, +#endif +#ifdef CONFIG_BFIN_SIR1 + { + .start = 0xFFC02000, + .end = 0xFFC020FF, + .flags = IORESOURCE_MEM, + }, +#endif +}; + +static struct platform_device bfin_sir_device = { + .name = "bfin_sir", + .id = 0, + .num_resources = ARRAY_SIZE(bfin_sir_resources), + .resource = bfin_sir_resources, +}; +#endif + #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) static struct resource bfin_twi0_resource[] = { [0] = { @@ -874,6 +900,10 @@ static struct platform_device *stamp_devices[] __initdata = { &bfin_uart_device, #endif +#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) + &bfin_sir_device, +#endif + #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) &i2c_bfin_twi_device, #endif @@ -896,7 +926,7 @@ static struct platform_device *stamp_devices[] __initdata = { static int __init stamp_init(void) { - printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); + printk(KERN_INFO "%s(): registering device resources\n", __func__); platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) spi_register_board_info(bfin_spi_board_info, diff --git a/arch/blackfin/mach-bf527/cpu.c b/arch/blackfin/mach-bf527/cpu.c deleted file mode 100644 index 1975402b1dbc..000000000000 --- a/arch/blackfin/mach-bf527/cpu.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * File: arch/blackfin/mach-bf527/cpu.c - * Based on: arch/blackfin/mach-bf537/cpu.c - * Author: michael.kang@analog.com - * - * Created: - * Description: clock scaling for the bf527 - * - * Modified: - * Copyright 2004-2007 Analog Devices Inc. - * - * Bugs: Enter bugs at http://blackfin.uclinux.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see the file COPYING, or write - * to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include <linux/kernel.h> -#include <linux/types.h> -#include <linux/init.h> -#include <linux/cpufreq.h> -#include <asm/dpmc.h> -#include <linux/fs.h> -#include <asm/bfin-global.h> - -/* CONFIG_CLKIN_HZ=11059200 */ -#define VCO5 (CONFIG_CLKIN_HZ*45) /*497664000 */ -#define VCO4 (CONFIG_CLKIN_HZ*36) /*398131200 */ -#define VCO3 (CONFIG_CLKIN_HZ*27) /*298598400 */ -#define VCO2 (CONFIG_CLKIN_HZ*18) /*199065600 */ -#define VCO1 (CONFIG_CLKIN_HZ*9) /*99532800 */ -#define VCO(x) VCO##x - -#define MFREQ(x) {VCO(x), VCO(x)/4}, {VCO(x), VCO(x)/2}, {VCO(x), VCO(x)} -/* frequency */ -static struct cpufreq_frequency_table bf527_freq_table[] = { - MFREQ(1), - MFREQ(3), - {VCO4, VCO4 / 2}, {VCO4, VCO4}, - MFREQ(5), - {0, CPUFREQ_TABLE_END}, -}; - -/* - * dpmc_fops->ioctl() - * static int dpmc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) - */ -static int bf527_getfreq(unsigned int cpu) -{ - unsigned long cclk_mhz; - - /* The driver only support single cpu */ - if (cpu == 0) - dpmc_fops.ioctl(NULL, NULL, IOCTL_GET_CORECLOCK, &cclk_mhz); - else - cclk_mhz = -1; - - return cclk_mhz; -} - -static int bf527_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) -{ - unsigned long cclk_mhz; - unsigned long vco_mhz; - unsigned long flags; - unsigned int index; - struct cpufreq_freqs freqs; - - if (cpufreq_frequency_table_target - (policy, bf527_freq_table, target_freq, relation, &index)) - return -EINVAL; - - cclk_mhz = bf527_freq_table[index].frequency; - vco_mhz = bf527_freq_table[index].index; - - dpmc_fops.ioctl(NULL, NULL, IOCTL_CHANGE_FREQUENCY, &vco_mhz); - freqs.old = bf527_getfreq(0); - freqs.new = cclk_mhz; - freqs.cpu = 0; - - pr_debug - ("cclk begin change to cclk %d,vco=%d,index=%d,target=%d,oldfreq=%d\n", - cclk_mhz, vco_mhz, index, target_freq, freqs.old); - - cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); - local_irq_save(flags); - dpmc_fops.ioctl(NULL, NULL, IOCTL_SET_CCLK, &cclk_mhz); - local_irq_restore(flags); - cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); - - vco_mhz = get_vco(); - cclk_mhz = get_cclk(); - return 0; -} - -/* make sure that only the "userspace" governor is run -- anything else wouldn't make sense on - * this platform, anyway. - */ -static int bf527_verify_speed(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, &bf527_freq_table); -} - -static int __init __bf527_cpu_init(struct cpufreq_policy *policy) -{ - if (policy->cpu != 0) - return -EINVAL; - - policy->governor = CPUFREQ_DEFAULT_GOVERNOR; - - policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; - /*Now ,only support one cpu */ - policy->cur = bf527_getfreq(0); - cpufreq_frequency_table_get_attr(bf527_freq_table, policy->cpu); - return cpufreq_frequency_table_cpuinfo(policy, bf527_freq_table); -} - -static struct freq_attr *bf527_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - -static struct cpufreq_driver bf527_driver = { - .verify = bf527_verify_speed, - .target = bf527_target, - .get = bf527_getfreq, - .init = __bf527_cpu_init, - .name = "bf527", - .owner = THIS_MODULE, - .attr = bf527_freq_attr, -}; - -static int __init bf527_cpu_init(void) -{ - return cpufreq_register_driver(&bf527_driver); -} - -static void __exit bf527_cpu_exit(void) -{ - cpufreq_unregister_driver(&bf527_driver); -} - -MODULE_AUTHOR("Mickael Kang"); -MODULE_DESCRIPTION("cpufreq driver for bf527 CPU"); -MODULE_LICENSE("GPL"); - -module_init(bf527_cpu_init); -module_exit(bf527_cpu_exit); diff --git a/arch/blackfin/mach-bf527/dma.c b/arch/blackfin/mach-bf527/dma.c index 522de24cc394..dfd080cda787 100644 --- a/arch/blackfin/mach-bf527/dma.c +++ b/arch/blackfin/mach-bf527/dma.c @@ -26,10 +26,12 @@ * to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <linux/module.h> + #include <asm/blackfin.h> #include <asm/dma.h> -struct dma_register *base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { +struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { (struct dma_register *) DMA0_NEXT_DESC_PTR, (struct dma_register *) DMA1_NEXT_DESC_PTR, (struct dma_register *) DMA2_NEXT_DESC_PTR, @@ -47,6 +49,7 @@ struct dma_register *base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { (struct dma_register *) MDMA_D1_NEXT_DESC_PTR, (struct dma_register *) MDMA_S1_NEXT_DESC_PTR, }; +EXPORT_SYMBOL(dma_io_base_addr); int channel2irq(unsigned int channel) { diff --git a/arch/blackfin/mach-bf527/head.S b/arch/blackfin/mach-bf527/head.S index cdb00a084965..57bdb3ba2fed 100644 --- a/arch/blackfin/mach-bf527/head.S +++ b/arch/blackfin/mach-bf527/head.S @@ -37,9 +37,6 @@ #include <asm/mach/mem_init.h> #endif -.global __rambase -.global __ramstart -.global __ramend .extern ___bss_stop .extern ___bss_start .extern _bf53x_relocate_l1_mem @@ -439,18 +436,3 @@ ENTRY(_start_dma_code) RTS; ENDPROC(_start_dma_code) #endif /* CONFIG_BFIN_KERNEL_CLOCK */ - -.data - -/* - * Set up the usable of RAM stuff. Size of RAM is determined then - * an initial stack set up at the end. - */ - -.align 4 -__rambase: -.long 0 -__ramstart: -.long 0 -__ramend: -.long 0 |