diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:52:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:52:35 -0500 |
commit | 525995d77ca08dfc2ba6f8e606f93694271dbd66 (patch) | |
tree | be9ddad66cd1301eea8dab7814cbda144a909e35 /arch/blackfin/kernel | |
parent | e4bdda1bc3123a9e65f4dd93a23041fde8ed3dc2 (diff) | |
parent | 64a2b168023bfd09037ba760838762e56c44178e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin: (88 commits)
Blackfin: Convert BUG() to use unreachable()
Blackfin: define __NR_recvmmsg
Blackfin: drop duplicate sched_clock
Blackfin: NOMPU: skip DMA ICPLB hole when it is redundant
Blackfin: MPU: add missing __init markings
Blackfin: add support for TIF_NOTIFY_RESUME
Blackfin: kgdb_test: clean up code a bit
Blackfin: convert kgdbtest to proc_fops
Blackfin: convert cyc2ns() to clocksource_cyc2ns()
Blackfin: ip0x: pull in asm/portmux.h for P_xxx defines
Blackfin: drop unused ax88180 resources
Blackfin: bf537-stamp: add ADF702x network driver resources
Blackfin: bf537-stamp: add CAN resources
Blackfin: bf537-stamp: add AD5258 i2c address
Blackfin: bf537-stamp: add adau1761 i2c address
Blackfin: bf537-stamp: add adau1371 i2c address
Blackfin: bf537-stamp: add ADP8870 resources
Blackfin: bf537-stamp: kill AD714x board-specific Kconfigs
Blackfin: bf537-stamp: update ADP5520 resources
Blackfin: bf537-stamp: add ADXL346 orientation sensing support
...
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/bfin_dma_5xx.c | 52 | ||||
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 99 | ||||
-rw-r--r-- | arch/blackfin/kernel/cplb-mpu/cplbinit.c | 2 | ||||
-rw-r--r-- | arch/blackfin/kernel/cplb-mpu/cplbmgr.c | 13 | ||||
-rw-r--r-- | arch/blackfin/kernel/cplb-nompu/cplbinit.c | 31 | ||||
-rw-r--r-- | arch/blackfin/kernel/dma-mapping.c | 68 | ||||
-rw-r--r-- | arch/blackfin/kernel/gptimers.c | 32 | ||||
-rw-r--r-- | arch/blackfin/kernel/ipipe.c | 67 | ||||
-rw-r--r-- | arch/blackfin/kernel/kgdb.c | 17 | ||||
-rw-r--r-- | arch/blackfin/kernel/kgdb_test.c | 67 | ||||
-rw-r--r-- | arch/blackfin/kernel/process.c | 95 | ||||
-rw-r--r-- | arch/blackfin/kernel/ptrace.c | 13 | ||||
-rw-r--r-- | arch/blackfin/kernel/setup.c | 46 | ||||
-rw-r--r-- | arch/blackfin/kernel/signal.c | 18 | ||||
-rw-r--r-- | arch/blackfin/kernel/time-ts.c | 47 | ||||
-rw-r--r-- | arch/blackfin/kernel/time.c | 8 | ||||
-rw-r--r-- | arch/blackfin/kernel/traps.c | 45 | ||||
-rw-r--r-- | arch/blackfin/kernel/vmlinux.lds.S | 28 |
18 files changed, 474 insertions, 274 deletions
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c index 3946aff4f414..924c00286bab 100644 --- a/arch/blackfin/kernel/bfin_dma_5xx.c +++ b/arch/blackfin/kernel/bfin_dma_5xx.c | |||
@@ -37,9 +37,8 @@ static int __init blackfin_dma_init(void) | |||
37 | printk(KERN_INFO "Blackfin DMA Controller\n"); | 37 | printk(KERN_INFO "Blackfin DMA Controller\n"); |
38 | 38 | ||
39 | for (i = 0; i < MAX_DMA_CHANNELS; i++) { | 39 | for (i = 0; i < MAX_DMA_CHANNELS; i++) { |
40 | dma_ch[i].chan_status = DMA_CHANNEL_FREE; | 40 | atomic_set(&dma_ch[i].chan_status, 0); |
41 | dma_ch[i].regs = dma_io_base_addr[i]; | 41 | dma_ch[i].regs = dma_io_base_addr[i]; |
42 | mutex_init(&(dma_ch[i].dmalock)); | ||
43 | } | 42 | } |
44 | /* Mark MEMDMA Channel 0 as requested since we're using it internally */ | 43 | /* Mark MEMDMA Channel 0 as requested since we're using it internally */ |
45 | request_dma(CH_MEM_STREAM0_DEST, "Blackfin dma_memcpy"); | 44 | request_dma(CH_MEM_STREAM0_DEST, "Blackfin dma_memcpy"); |
@@ -60,7 +59,7 @@ static int proc_dma_show(struct seq_file *m, void *v) | |||
60 | int i; | 59 | int i; |
61 | 60 | ||
62 | for (i = 0; i < MAX_DMA_CHANNELS; ++i) | 61 | for (i = 0; i < MAX_DMA_CHANNELS; ++i) |
63 | if (dma_ch[i].chan_status != DMA_CHANNEL_FREE) | 62 | if (dma_channel_active(i)) |
64 | seq_printf(m, "%2d: %s\n", i, dma_ch[i].device_id); | 63 | seq_printf(m, "%2d: %s\n", i, dma_ch[i].device_id); |
65 | 64 | ||
66 | return 0; | 65 | return 0; |
@@ -107,20 +106,11 @@ int request_dma(unsigned int channel, const char *device_id) | |||
107 | } | 106 | } |
108 | #endif | 107 | #endif |
109 | 108 | ||
110 | mutex_lock(&(dma_ch[channel].dmalock)); | 109 | if (atomic_cmpxchg(&dma_ch[channel].chan_status, 0, 1)) { |
111 | |||
112 | if ((dma_ch[channel].chan_status == DMA_CHANNEL_REQUESTED) | ||
113 | || (dma_ch[channel].chan_status == DMA_CHANNEL_ENABLED)) { | ||
114 | mutex_unlock(&(dma_ch[channel].dmalock)); | ||
115 | pr_debug("DMA CHANNEL IN USE \n"); | 110 | pr_debug("DMA CHANNEL IN USE \n"); |
116 | return -EBUSY; | 111 | return -EBUSY; |
117 | } else { | ||
118 | dma_ch[channel].chan_status = DMA_CHANNEL_REQUESTED; | ||
119 | pr_debug("DMA CHANNEL IS ALLOCATED \n"); | ||
120 | } | 112 | } |
121 | 113 | ||
122 | mutex_unlock(&(dma_ch[channel].dmalock)); | ||
123 | |||
124 | #ifdef CONFIG_BF54x | 114 | #ifdef CONFIG_BF54x |
125 | if (channel >= CH_UART2_RX && channel <= CH_UART3_TX) { | 115 | if (channel >= CH_UART2_RX && channel <= CH_UART3_TX) { |
126 | unsigned int per_map; | 116 | unsigned int per_map; |
@@ -148,21 +138,20 @@ EXPORT_SYMBOL(request_dma); | |||
148 | 138 | ||
149 | int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data) | 139 | int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data) |
150 | { | 140 | { |
151 | BUG_ON(channel >= MAX_DMA_CHANNELS || | 141 | int ret; |
152 | dma_ch[channel].chan_status == DMA_CHANNEL_FREE); | 142 | unsigned int irq; |
153 | 143 | ||
154 | if (callback != NULL) { | 144 | BUG_ON(channel >= MAX_DMA_CHANNELS || !callback || |
155 | int ret; | 145 | !atomic_read(&dma_ch[channel].chan_status)); |
156 | unsigned int irq = channel2irq(channel); | ||
157 | 146 | ||
158 | ret = request_irq(irq, callback, IRQF_DISABLED, | 147 | irq = channel2irq(channel); |
159 | dma_ch[channel].device_id, data); | 148 | ret = request_irq(irq, callback, 0, dma_ch[channel].device_id, data); |
160 | if (ret) | 149 | if (ret) |
161 | return ret; | 150 | return ret; |
151 | |||
152 | dma_ch[channel].irq = irq; | ||
153 | dma_ch[channel].data = data; | ||
162 | 154 | ||
163 | dma_ch[channel].irq = irq; | ||
164 | dma_ch[channel].data = data; | ||
165 | } | ||
166 | return 0; | 155 | return 0; |
167 | } | 156 | } |
168 | EXPORT_SYMBOL(set_dma_callback); | 157 | EXPORT_SYMBOL(set_dma_callback); |
@@ -184,7 +173,7 @@ void free_dma(unsigned int channel) | |||
184 | { | 173 | { |
185 | pr_debug("freedma() : BEGIN \n"); | 174 | pr_debug("freedma() : BEGIN \n"); |
186 | BUG_ON(channel >= MAX_DMA_CHANNELS || | 175 | BUG_ON(channel >= MAX_DMA_CHANNELS || |
187 | dma_ch[channel].chan_status == DMA_CHANNEL_FREE); | 176 | !atomic_read(&dma_ch[channel].chan_status)); |
188 | 177 | ||
189 | /* Halt the DMA */ | 178 | /* Halt the DMA */ |
190 | disable_dma(channel); | 179 | disable_dma(channel); |
@@ -194,9 +183,7 @@ void free_dma(unsigned int channel) | |||
194 | free_irq(dma_ch[channel].irq, dma_ch[channel].data); | 183 | free_irq(dma_ch[channel].irq, dma_ch[channel].data); |
195 | 184 | ||
196 | /* Clear the DMA Variable in the Channel */ | 185 | /* Clear the DMA Variable in the Channel */ |
197 | mutex_lock(&(dma_ch[channel].dmalock)); | 186 | atomic_set(&dma_ch[channel].chan_status, 0); |
198 | dma_ch[channel].chan_status = DMA_CHANNEL_FREE; | ||
199 | mutex_unlock(&(dma_ch[channel].dmalock)); | ||
200 | 187 | ||
201 | pr_debug("freedma() : END \n"); | 188 | pr_debug("freedma() : END \n"); |
202 | } | 189 | } |
@@ -210,13 +197,14 @@ int blackfin_dma_suspend(void) | |||
210 | { | 197 | { |
211 | int i; | 198 | int i; |
212 | 199 | ||
213 | for (i = 0; i < MAX_DMA_SUSPEND_CHANNELS; ++i) { | 200 | for (i = 0; i < MAX_DMA_CHANNELS; ++i) { |
214 | if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) { | 201 | if (dma_ch[i].regs->cfg & DMAEN) { |
215 | printk(KERN_ERR "DMA Channel %d failed to suspend\n", i); | 202 | printk(KERN_ERR "DMA Channel %d failed to suspend\n", i); |
216 | return -EBUSY; | 203 | return -EBUSY; |
217 | } | 204 | } |
218 | 205 | ||
219 | dma_ch[i].saved_peripheral_map = dma_ch[i].regs->peripheral_map; | 206 | if (i < MAX_DMA_SUSPEND_CHANNELS) |
207 | dma_ch[i].saved_peripheral_map = dma_ch[i].regs->peripheral_map; | ||
220 | } | 208 | } |
221 | 209 | ||
222 | return 0; | 210 | return 0; |
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 22705eeff34f..a174596cc009 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c | |||
@@ -100,6 +100,12 @@ u8 pmux_offset[][16] = { | |||
100 | }; | 100 | }; |
101 | # endif | 101 | # endif |
102 | 102 | ||
103 | #elif defined(BF538_FAMILY) | ||
104 | static unsigned short * const port_fer[] = { | ||
105 | (unsigned short *) PORTCIO_FER, | ||
106 | (unsigned short *) PORTDIO_FER, | ||
107 | (unsigned short *) PORTEIO_FER, | ||
108 | }; | ||
103 | #endif | 109 | #endif |
104 | 110 | ||
105 | static unsigned short reserved_gpio_map[GPIO_BANK_NUM]; | 111 | static unsigned short reserved_gpio_map[GPIO_BANK_NUM]; |
@@ -163,6 +169,27 @@ static int cmp_label(unsigned short ident, const char *label) | |||
163 | 169 | ||
164 | static void port_setup(unsigned gpio, unsigned short usage) | 170 | static void port_setup(unsigned gpio, unsigned short usage) |
165 | { | 171 | { |
172 | #if defined(BF538_FAMILY) | ||
173 | /* | ||
174 | * BF538/9 Port C,D and E are special. | ||
175 | * Inverted PORT_FER polarity on CDE and no PORF_FER on F | ||
176 | * Regular PORT F GPIOs are handled here, CDE are exclusively | ||
177 | * managed by GPIOLIB | ||
178 | */ | ||
179 | |||
180 | if (gpio < MAX_BLACKFIN_GPIOS || gpio >= MAX_RESOURCES) | ||
181 | return; | ||
182 | |||
183 | gpio -= MAX_BLACKFIN_GPIOS; | ||
184 | |||
185 | if (usage == GPIO_USAGE) | ||
186 | *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); | ||
187 | else | ||
188 | *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); | ||
189 | SSYNC(); | ||
190 | return; | ||
191 | #endif | ||
192 | |||
166 | if (check_gpio(gpio)) | 193 | if (check_gpio(gpio)) |
167 | return; | 194 | return; |
168 | 195 | ||
@@ -762,6 +789,8 @@ int peripheral_request(unsigned short per, const char *label) | |||
762 | if (!(per & P_DEFINED)) | 789 | if (!(per & P_DEFINED)) |
763 | return -ENODEV; | 790 | return -ENODEV; |
764 | 791 | ||
792 | BUG_ON(ident >= MAX_RESOURCES); | ||
793 | |||
765 | local_irq_save_hw(flags); | 794 | local_irq_save_hw(flags); |
766 | 795 | ||
767 | /* If a pin can be muxed as either GPIO or peripheral, make | 796 | /* If a pin can be muxed as either GPIO or peripheral, make |
@@ -979,6 +1008,76 @@ void bfin_gpio_free(unsigned gpio) | |||
979 | } | 1008 | } |
980 | EXPORT_SYMBOL(bfin_gpio_free); | 1009 | EXPORT_SYMBOL(bfin_gpio_free); |
981 | 1010 | ||
1011 | #ifdef BFIN_SPECIAL_GPIO_BANKS | ||
1012 | static unsigned short reserved_special_gpio_map[gpio_bank(MAX_RESOURCES)]; | ||
1013 | |||
1014 | int bfin_special_gpio_request(unsigned gpio, const char *label) | ||
1015 | { | ||
1016 | unsigned long flags; | ||
1017 | |||
1018 | local_irq_save_hw(flags); | ||
1019 | |||
1020 | /* | ||
1021 | * Allow that the identical GPIO can | ||
1022 | * be requested from the same driver twice | ||
1023 | * Do nothing and return - | ||
1024 | */ | ||
1025 | |||
1026 | if (cmp_label(gpio, label) == 0) { | ||
1027 | local_irq_restore_hw(flags); | ||
1028 | return 0; | ||
1029 | } | ||
1030 | |||
1031 | if (unlikely(reserved_special_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) { | ||
1032 | local_irq_restore_hw(flags); | ||
1033 | printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n", | ||
1034 | gpio, get_label(gpio)); | ||
1035 | |||
1036 | return -EBUSY; | ||
1037 | } | ||
1038 | if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { | ||
1039 | local_irq_restore_hw(flags); | ||
1040 | printk(KERN_ERR | ||
1041 | "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n", | ||
1042 | gpio, get_label(gpio)); | ||
1043 | |||
1044 | return -EBUSY; | ||
1045 | } | ||
1046 | |||
1047 | reserved_special_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio); | ||
1048 | reserved_peri_map[gpio_bank(gpio)] |= gpio_bit(gpio); | ||
1049 | |||
1050 | set_label(gpio, label); | ||
1051 | local_irq_restore_hw(flags); | ||
1052 | port_setup(gpio, GPIO_USAGE); | ||
1053 | |||
1054 | return 0; | ||
1055 | } | ||
1056 | EXPORT_SYMBOL(bfin_special_gpio_request); | ||
1057 | |||
1058 | void bfin_special_gpio_free(unsigned gpio) | ||
1059 | { | ||
1060 | unsigned long flags; | ||
1061 | |||
1062 | might_sleep(); | ||
1063 | |||
1064 | local_irq_save_hw(flags); | ||
1065 | |||
1066 | if (unlikely(!(reserved_special_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { | ||
1067 | gpio_error(gpio); | ||
1068 | local_irq_restore_hw(flags); | ||
1069 | return; | ||
1070 | } | ||
1071 | |||
1072 | reserved_special_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); | ||
1073 | reserved_peri_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); | ||
1074 | set_label(gpio, "free"); | ||
1075 | local_irq_restore_hw(flags); | ||
1076 | } | ||
1077 | EXPORT_SYMBOL(bfin_special_gpio_free); | ||
1078 | #endif | ||
1079 | |||
1080 | |||
982 | int bfin_gpio_irq_request(unsigned gpio, const char *label) | 1081 | int bfin_gpio_irq_request(unsigned gpio, const char *label) |
983 | { | 1082 | { |
984 | unsigned long flags; | 1083 | unsigned long flags; |
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c index b52c1f8c4bc0..8d42b9e50dfa 100644 --- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c +++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c | |||
@@ -92,6 +92,6 @@ void __init generate_cplb_tables_cpu(unsigned int cpu) | |||
92 | icplb_tbl[cpu][i_i++].data = 0; | 92 | icplb_tbl[cpu][i_i++].data = 0; |
93 | } | 93 | } |
94 | 94 | ||
95 | void generate_cplb_tables_all(void) | 95 | void __init generate_cplb_tables_all(void) |
96 | { | 96 | { |
97 | } | 97 | } |
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbmgr.c b/arch/blackfin/kernel/cplb-mpu/cplbmgr.c index 69e0e530d70f..930c01c06813 100644 --- a/arch/blackfin/kernel/cplb-mpu/cplbmgr.c +++ b/arch/blackfin/kernel/cplb-mpu/cplbmgr.c | |||
@@ -113,11 +113,11 @@ static noinline int dcplb_miss(unsigned int cpu) | |||
113 | addr = L2_START; | 113 | addr = L2_START; |
114 | d_data = L2_DMEMORY; | 114 | d_data = L2_DMEMORY; |
115 | } else if (addr >= physical_mem_end) { | 115 | } else if (addr >= physical_mem_end) { |
116 | if (addr >= ASYNC_BANK0_BASE && addr < ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE | 116 | if (addr >= ASYNC_BANK0_BASE && addr < ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE) { |
117 | && (status & FAULT_USERSUPV)) { | 117 | addr &= ~(4 * 1024 * 1024 - 1); |
118 | addr &= ~0x3fffff; | ||
119 | d_data &= ~PAGE_SIZE_4KB; | 118 | d_data &= ~PAGE_SIZE_4KB; |
120 | d_data |= PAGE_SIZE_4MB; | 119 | d_data |= PAGE_SIZE_4MB; |
120 | d_data |= CPLB_USER_RD | CPLB_USER_WR; | ||
121 | } else if (addr >= BOOT_ROM_START && addr < BOOT_ROM_START + BOOT_ROM_LENGTH | 121 | } else if (addr >= BOOT_ROM_START && addr < BOOT_ROM_START + BOOT_ROM_LENGTH |
122 | && (status & (FAULT_RW | FAULT_USERSUPV)) == FAULT_USERSUPV) { | 122 | && (status & (FAULT_RW | FAULT_USERSUPV)) == FAULT_USERSUPV) { |
123 | addr &= ~(1 * 1024 * 1024 - 1); | 123 | addr &= ~(1 * 1024 * 1024 - 1); |
@@ -203,7 +203,12 @@ static noinline int icplb_miss(unsigned int cpu) | |||
203 | addr = L2_START; | 203 | addr = L2_START; |
204 | i_data = L2_IMEMORY; | 204 | i_data = L2_IMEMORY; |
205 | } else if (addr >= physical_mem_end) { | 205 | } else if (addr >= physical_mem_end) { |
206 | if (addr >= BOOT_ROM_START && addr < BOOT_ROM_START + BOOT_ROM_LENGTH | 206 | if (addr >= ASYNC_BANK0_BASE && addr < ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE) { |
207 | addr &= ~(4 * 1024 * 1024 - 1); | ||
208 | i_data &= ~PAGE_SIZE_4KB; | ||
209 | i_data |= PAGE_SIZE_4MB; | ||
210 | i_data |= CPLB_USER_RD; | ||
211 | } else if (addr >= BOOT_ROM_START && addr < BOOT_ROM_START + BOOT_ROM_LENGTH | ||
207 | && (status & FAULT_USERSUPV)) { | 212 | && (status & FAULT_USERSUPV)) { |
208 | addr &= ~(1 * 1024 * 1024 - 1); | 213 | addr &= ~(1 * 1024 * 1024 - 1); |
209 | i_data &= ~PAGE_SIZE_4KB; | 214 | i_data &= ~PAGE_SIZE_4KB; |
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c index fd9a2f31e686..282a7919821b 100644 --- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c +++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c | |||
@@ -89,15 +89,25 @@ void __init generate_cplb_tables_cpu(unsigned int cpu) | |||
89 | 89 | ||
90 | void __init generate_cplb_tables_all(void) | 90 | void __init generate_cplb_tables_all(void) |
91 | { | 91 | { |
92 | unsigned long uncached_end; | ||
92 | int i_d, i_i; | 93 | int i_d, i_i; |
93 | 94 | ||
94 | i_d = 0; | 95 | i_d = 0; |
95 | /* Normal RAM, including MTD FS. */ | 96 | /* Normal RAM, including MTD FS. */ |
96 | #ifdef CONFIG_MTD_UCLINUX | 97 | #ifdef CONFIG_MTD_UCLINUX |
97 | dcplb_bounds[i_d].eaddr = memory_mtd_start + mtd_size; | 98 | uncached_end = memory_mtd_start + mtd_size; |
98 | #else | 99 | #else |
99 | dcplb_bounds[i_d].eaddr = memory_end; | 100 | uncached_end = memory_end; |
100 | #endif | 101 | #endif |
102 | /* | ||
103 | * if DMA uncached is less than 1MB, mark the 1MB chunk as uncached | ||
104 | * so that we don't have to use 4kB pages and cause CPLB thrashing | ||
105 | */ | ||
106 | if ((DMA_UNCACHED_REGION >= 1 * 1024 * 1024) || !DMA_UNCACHED_REGION || | ||
107 | ((_ramend - uncached_end) >= 1 * 1024 * 1024)) | ||
108 | dcplb_bounds[i_d].eaddr = uncached_end; | ||
109 | else | ||
110 | dcplb_bounds[i_d].eaddr = uncached_end & ~(1 * 1024 * 1024); | ||
101 | dcplb_bounds[i_d++].data = SDRAM_DGENERIC; | 111 | dcplb_bounds[i_d++].data = SDRAM_DGENERIC; |
102 | /* DMA uncached region. */ | 112 | /* DMA uncached region. */ |
103 | if (DMA_UNCACHED_REGION) { | 113 | if (DMA_UNCACHED_REGION) { |
@@ -135,18 +145,15 @@ void __init generate_cplb_tables_all(void) | |||
135 | 145 | ||
136 | i_i = 0; | 146 | i_i = 0; |
137 | /* Normal RAM, including MTD FS. */ | 147 | /* Normal RAM, including MTD FS. */ |
138 | #ifdef CONFIG_MTD_UCLINUX | 148 | icplb_bounds[i_i].eaddr = uncached_end; |
139 | icplb_bounds[i_i].eaddr = memory_mtd_start + mtd_size; | ||
140 | #else | ||
141 | icplb_bounds[i_i].eaddr = memory_end; | ||
142 | #endif | ||
143 | icplb_bounds[i_i++].data = SDRAM_IGENERIC; | 149 | icplb_bounds[i_i++].data = SDRAM_IGENERIC; |
144 | /* DMA uncached region. */ | ||
145 | if (DMA_UNCACHED_REGION) { | ||
146 | icplb_bounds[i_i].eaddr = _ramend; | ||
147 | icplb_bounds[i_i++].data = 0; | ||
148 | } | ||
149 | if (_ramend != physical_mem_end) { | 150 | if (_ramend != physical_mem_end) { |
151 | /* DMA uncached region. */ | ||
152 | if (DMA_UNCACHED_REGION) { | ||
153 | /* Normally this hole is caught by the async below. */ | ||
154 | icplb_bounds[i_i].eaddr = _ramend; | ||
155 | icplb_bounds[i_i++].data = 0; | ||
156 | } | ||
150 | /* Reserved memory. */ | 157 | /* Reserved memory. */ |
151 | icplb_bounds[i_i].eaddr = physical_mem_end; | 158 | icplb_bounds[i_i].eaddr = physical_mem_end; |
152 | icplb_bounds[i_i++].data = (reserved_mem_icache_on ? | 159 | icplb_bounds[i_i++].data = (reserved_mem_icache_on ? |
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index e74e74d7733f..e937f323d82c 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c | |||
@@ -7,30 +7,25 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/mm.h> | 10 | #include <linux/gfp.h> |
11 | #include <linux/string.h> | 11 | #include <linux/string.h> |
12 | #include <linux/bootmem.h> | ||
13 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
14 | #include <linux/device.h> | ||
15 | #include <linux/dma-mapping.h> | 13 | #include <linux/dma-mapping.h> |
16 | #include <linux/io.h> | ||
17 | #include <linux/scatterlist.h> | 14 | #include <linux/scatterlist.h> |
18 | #include <asm/cacheflush.h> | ||
19 | #include <asm/bfin-global.h> | ||
20 | 15 | ||
21 | static spinlock_t dma_page_lock; | 16 | static spinlock_t dma_page_lock; |
22 | static unsigned int *dma_page; | 17 | static unsigned long *dma_page; |
23 | static unsigned int dma_pages; | 18 | static unsigned int dma_pages; |
24 | static unsigned long dma_base; | 19 | static unsigned long dma_base; |
25 | static unsigned long dma_size; | 20 | static unsigned long dma_size; |
26 | static unsigned int dma_initialized; | 21 | static unsigned int dma_initialized; |
27 | 22 | ||
28 | void dma_alloc_init(unsigned long start, unsigned long end) | 23 | static void dma_alloc_init(unsigned long start, unsigned long end) |
29 | { | 24 | { |
30 | spin_lock_init(&dma_page_lock); | 25 | spin_lock_init(&dma_page_lock); |
31 | dma_initialized = 0; | 26 | dma_initialized = 0; |
32 | 27 | ||
33 | dma_page = (unsigned int *)__get_free_page(GFP_KERNEL); | 28 | dma_page = (unsigned long *)__get_free_page(GFP_KERNEL); |
34 | memset(dma_page, 0, PAGE_SIZE); | 29 | memset(dma_page, 0, PAGE_SIZE); |
35 | dma_base = PAGE_ALIGN(start); | 30 | dma_base = PAGE_ALIGN(start); |
36 | dma_size = PAGE_ALIGN(end) - PAGE_ALIGN(start); | 31 | dma_size = PAGE_ALIGN(end) - PAGE_ALIGN(start); |
@@ -58,10 +53,11 @@ static unsigned long __alloc_dma_pages(unsigned int pages) | |||
58 | spin_lock_irqsave(&dma_page_lock, flags); | 53 | spin_lock_irqsave(&dma_page_lock, flags); |
59 | 54 | ||
60 | for (i = 0; i < dma_pages;) { | 55 | for (i = 0; i < dma_pages;) { |
61 | if (dma_page[i++] == 0) { | 56 | if (test_bit(i++, dma_page) == 0) { |
62 | if (++count == pages) { | 57 | if (++count == pages) { |
63 | while (count--) | 58 | while (count--) |
64 | dma_page[--i] = 1; | 59 | __set_bit(--i, dma_page); |
60 | |||
65 | ret = dma_base + (i << PAGE_SHIFT); | 61 | ret = dma_base + (i << PAGE_SHIFT); |
66 | break; | 62 | break; |
67 | } | 63 | } |
@@ -84,14 +80,14 @@ static void __free_dma_pages(unsigned long addr, unsigned int pages) | |||
84 | } | 80 | } |
85 | 81 | ||
86 | spin_lock_irqsave(&dma_page_lock, flags); | 82 | spin_lock_irqsave(&dma_page_lock, flags); |
87 | for (i = page; i < page + pages; i++) { | 83 | for (i = page; i < page + pages; i++) |
88 | dma_page[i] = 0; | 84 | __clear_bit(i, dma_page); |
89 | } | 85 | |
90 | spin_unlock_irqrestore(&dma_page_lock, flags); | 86 | spin_unlock_irqrestore(&dma_page_lock, flags); |
91 | } | 87 | } |
92 | 88 | ||
93 | void *dma_alloc_coherent(struct device *dev, size_t size, | 89 | void *dma_alloc_coherent(struct device *dev, size_t size, |
94 | dma_addr_t * dma_handle, gfp_t gfp) | 90 | dma_addr_t *dma_handle, gfp_t gfp) |
95 | { | 91 | { |
96 | void *ret; | 92 | void *ret; |
97 | 93 | ||
@@ -115,21 +111,14 @@ dma_free_coherent(struct device *dev, size_t size, void *vaddr, | |||
115 | EXPORT_SYMBOL(dma_free_coherent); | 111 | EXPORT_SYMBOL(dma_free_coherent); |
116 | 112 | ||
117 | /* | 113 | /* |
118 | * Dummy functions defined for some existing drivers | 114 | * Streaming DMA mappings |
119 | */ | 115 | */ |
120 | 116 | void __dma_sync(dma_addr_t addr, size_t size, | |
121 | dma_addr_t | 117 | enum dma_data_direction dir) |
122 | dma_map_single(struct device *dev, void *ptr, size_t size, | ||
123 | enum dma_data_direction direction) | ||
124 | { | 118 | { |
125 | BUG_ON(direction == DMA_NONE); | 119 | _dma_sync(addr, size, dir); |
126 | |||
127 | invalidate_dcache_range((unsigned long)ptr, | ||
128 | (unsigned long)ptr + size); | ||
129 | |||
130 | return (dma_addr_t) ptr; | ||
131 | } | 120 | } |
132 | EXPORT_SYMBOL(dma_map_single); | 121 | EXPORT_SYMBOL(__dma_sync); |
133 | 122 | ||
134 | int | 123 | int |
135 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | 124 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, |
@@ -137,30 +126,23 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
137 | { | 126 | { |
138 | int i; | 127 | int i; |
139 | 128 | ||
140 | BUG_ON(direction == DMA_NONE); | ||
141 | |||
142 | for (i = 0; i < nents; i++, sg++) { | 129 | for (i = 0; i < nents; i++, sg++) { |
143 | sg->dma_address = (dma_addr_t) sg_virt(sg); | 130 | sg->dma_address = (dma_addr_t) sg_virt(sg); |
144 | 131 | __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction); | |
145 | invalidate_dcache_range(sg_dma_address(sg), | ||
146 | sg_dma_address(sg) + | ||
147 | sg_dma_len(sg)); | ||
148 | } | 132 | } |
149 | 133 | ||
150 | return nents; | 134 | return nents; |
151 | } | 135 | } |
152 | EXPORT_SYMBOL(dma_map_sg); | 136 | EXPORT_SYMBOL(dma_map_sg); |
153 | 137 | ||
154 | void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | 138 | void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, |
155 | enum dma_data_direction direction) | 139 | int nelems, enum dma_data_direction direction) |
156 | { | 140 | { |
157 | BUG_ON(direction == DMA_NONE); | 141 | int i; |
158 | } | ||
159 | EXPORT_SYMBOL(dma_unmap_single); | ||
160 | 142 | ||
161 | void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | 143 | for (i = 0; i < nelems; i++, sg++) { |
162 | int nhwentries, enum dma_data_direction direction) | 144 | sg->dma_address = (dma_addr_t) sg_virt(sg); |
163 | { | 145 | __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction); |
164 | BUG_ON(direction == DMA_NONE); | 146 | } |
165 | } | 147 | } |
166 | EXPORT_SYMBOL(dma_unmap_sg); | 148 | EXPORT_SYMBOL(dma_sync_sg_for_device); |
diff --git a/arch/blackfin/kernel/gptimers.c b/arch/blackfin/kernel/gptimers.c index 7281a91d26b5..cdbe075de1dc 100644 --- a/arch/blackfin/kernel/gptimers.c +++ b/arch/blackfin/kernel/gptimers.c | |||
@@ -137,7 +137,7 @@ static uint32_t const timil_mask[MAX_BLACKFIN_GPTIMERS] = | |||
137 | #endif | 137 | #endif |
138 | }; | 138 | }; |
139 | 139 | ||
140 | void set_gptimer_pwidth(int timer_id, uint32_t value) | 140 | void set_gptimer_pwidth(unsigned int timer_id, uint32_t value) |
141 | { | 141 | { |
142 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 142 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
143 | timer_regs[timer_id]->width = value; | 143 | timer_regs[timer_id]->width = value; |
@@ -145,14 +145,14 @@ void set_gptimer_pwidth(int timer_id, uint32_t value) | |||
145 | } | 145 | } |
146 | EXPORT_SYMBOL(set_gptimer_pwidth); | 146 | EXPORT_SYMBOL(set_gptimer_pwidth); |
147 | 147 | ||
148 | uint32_t get_gptimer_pwidth(int timer_id) | 148 | uint32_t get_gptimer_pwidth(unsigned int timer_id) |
149 | { | 149 | { |
150 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 150 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
151 | return timer_regs[timer_id]->width; | 151 | return timer_regs[timer_id]->width; |
152 | } | 152 | } |
153 | EXPORT_SYMBOL(get_gptimer_pwidth); | 153 | EXPORT_SYMBOL(get_gptimer_pwidth); |
154 | 154 | ||
155 | void set_gptimer_period(int timer_id, uint32_t period) | 155 | void set_gptimer_period(unsigned int timer_id, uint32_t period) |
156 | { | 156 | { |
157 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 157 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
158 | timer_regs[timer_id]->period = period; | 158 | timer_regs[timer_id]->period = period; |
@@ -160,28 +160,28 @@ void set_gptimer_period(int timer_id, uint32_t period) | |||
160 | } | 160 | } |
161 | EXPORT_SYMBOL(set_gptimer_period); | 161 | EXPORT_SYMBOL(set_gptimer_period); |
162 | 162 | ||
163 | uint32_t get_gptimer_period(int timer_id) | 163 | uint32_t get_gptimer_period(unsigned int timer_id) |
164 | { | 164 | { |
165 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 165 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
166 | return timer_regs[timer_id]->period; | 166 | return timer_regs[timer_id]->period; |
167 | } | 167 | } |
168 | EXPORT_SYMBOL(get_gptimer_period); | 168 | EXPORT_SYMBOL(get_gptimer_period); |
169 | 169 | ||
170 | uint32_t get_gptimer_count(int timer_id) | 170 | uint32_t get_gptimer_count(unsigned int timer_id) |
171 | { | 171 | { |
172 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 172 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
173 | return timer_regs[timer_id]->counter; | 173 | return timer_regs[timer_id]->counter; |
174 | } | 174 | } |
175 | EXPORT_SYMBOL(get_gptimer_count); | 175 | EXPORT_SYMBOL(get_gptimer_count); |
176 | 176 | ||
177 | uint32_t get_gptimer_status(int group) | 177 | uint32_t get_gptimer_status(unsigned int group) |
178 | { | 178 | { |
179 | tassert(group < BFIN_TIMER_NUM_GROUP); | 179 | tassert(group < BFIN_TIMER_NUM_GROUP); |
180 | return group_regs[group]->status; | 180 | return group_regs[group]->status; |
181 | } | 181 | } |
182 | EXPORT_SYMBOL(get_gptimer_status); | 182 | EXPORT_SYMBOL(get_gptimer_status); |
183 | 183 | ||
184 | void set_gptimer_status(int group, uint32_t value) | 184 | void set_gptimer_status(unsigned int group, uint32_t value) |
185 | { | 185 | { |
186 | tassert(group < BFIN_TIMER_NUM_GROUP); | 186 | tassert(group < BFIN_TIMER_NUM_GROUP); |
187 | group_regs[group]->status = value; | 187 | group_regs[group]->status = value; |
@@ -189,42 +189,42 @@ void set_gptimer_status(int group, uint32_t value) | |||
189 | } | 189 | } |
190 | EXPORT_SYMBOL(set_gptimer_status); | 190 | EXPORT_SYMBOL(set_gptimer_status); |
191 | 191 | ||
192 | int get_gptimer_intr(int timer_id) | 192 | int get_gptimer_intr(unsigned int timer_id) |
193 | { | 193 | { |
194 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 194 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
195 | return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & timil_mask[timer_id]); | 195 | return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & timil_mask[timer_id]); |
196 | } | 196 | } |
197 | EXPORT_SYMBOL(get_gptimer_intr); | 197 | EXPORT_SYMBOL(get_gptimer_intr); |
198 | 198 | ||
199 | void clear_gptimer_intr(int timer_id) | 199 | void clear_gptimer_intr(unsigned int timer_id) |
200 | { | 200 | { |
201 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 201 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
202 | group_regs[BFIN_TIMER_OCTET(timer_id)]->status = timil_mask[timer_id]; | 202 | group_regs[BFIN_TIMER_OCTET(timer_id)]->status = timil_mask[timer_id]; |
203 | } | 203 | } |
204 | EXPORT_SYMBOL(clear_gptimer_intr); | 204 | EXPORT_SYMBOL(clear_gptimer_intr); |
205 | 205 | ||
206 | int get_gptimer_over(int timer_id) | 206 | int get_gptimer_over(unsigned int timer_id) |
207 | { | 207 | { |
208 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 208 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
209 | return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & tovf_mask[timer_id]); | 209 | return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & tovf_mask[timer_id]); |
210 | } | 210 | } |
211 | EXPORT_SYMBOL(get_gptimer_over); | 211 | EXPORT_SYMBOL(get_gptimer_over); |
212 | 212 | ||
213 | void clear_gptimer_over(int timer_id) | 213 | void clear_gptimer_over(unsigned int timer_id) |
214 | { | 214 | { |
215 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 215 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
216 | group_regs[BFIN_TIMER_OCTET(timer_id)]->status = tovf_mask[timer_id]; | 216 | group_regs[BFIN_TIMER_OCTET(timer_id)]->status = tovf_mask[timer_id]; |
217 | } | 217 | } |
218 | EXPORT_SYMBOL(clear_gptimer_over); | 218 | EXPORT_SYMBOL(clear_gptimer_over); |
219 | 219 | ||
220 | int get_gptimer_run(int timer_id) | 220 | int get_gptimer_run(unsigned int timer_id) |
221 | { | 221 | { |
222 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 222 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
223 | return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & trun_mask[timer_id]); | 223 | return !!(group_regs[BFIN_TIMER_OCTET(timer_id)]->status & trun_mask[timer_id]); |
224 | } | 224 | } |
225 | EXPORT_SYMBOL(get_gptimer_run); | 225 | EXPORT_SYMBOL(get_gptimer_run); |
226 | 226 | ||
227 | void set_gptimer_config(int timer_id, uint16_t config) | 227 | void set_gptimer_config(unsigned int timer_id, uint16_t config) |
228 | { | 228 | { |
229 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 229 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
230 | timer_regs[timer_id]->config = config; | 230 | timer_regs[timer_id]->config = config; |
@@ -232,7 +232,7 @@ void set_gptimer_config(int timer_id, uint16_t config) | |||
232 | } | 232 | } |
233 | EXPORT_SYMBOL(set_gptimer_config); | 233 | EXPORT_SYMBOL(set_gptimer_config); |
234 | 234 | ||
235 | uint16_t get_gptimer_config(int timer_id) | 235 | uint16_t get_gptimer_config(unsigned int timer_id) |
236 | { | 236 | { |
237 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 237 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
238 | return timer_regs[timer_id]->config; | 238 | return timer_regs[timer_id]->config; |
@@ -280,7 +280,7 @@ void disable_gptimers_sync(uint16_t mask) | |||
280 | } | 280 | } |
281 | EXPORT_SYMBOL(disable_gptimers_sync); | 281 | EXPORT_SYMBOL(disable_gptimers_sync); |
282 | 282 | ||
283 | void set_gptimer_pulse_hi(int timer_id) | 283 | void set_gptimer_pulse_hi(unsigned int timer_id) |
284 | { | 284 | { |
285 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 285 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
286 | timer_regs[timer_id]->config |= TIMER_PULSE_HI; | 286 | timer_regs[timer_id]->config |= TIMER_PULSE_HI; |
@@ -288,7 +288,7 @@ void set_gptimer_pulse_hi(int timer_id) | |||
288 | } | 288 | } |
289 | EXPORT_SYMBOL(set_gptimer_pulse_hi); | 289 | EXPORT_SYMBOL(set_gptimer_pulse_hi); |
290 | 290 | ||
291 | void clear_gptimer_pulse_hi(int timer_id) | 291 | void clear_gptimer_pulse_hi(unsigned int timer_id) |
292 | { | 292 | { |
293 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); | 293 | tassert(timer_id < MAX_BLACKFIN_GPTIMERS); |
294 | timer_regs[timer_id]->config &= ~TIMER_PULSE_HI; | 294 | timer_regs[timer_id]->config &= ~TIMER_PULSE_HI; |
diff --git a/arch/blackfin/kernel/ipipe.c b/arch/blackfin/kernel/ipipe.c index 5d7382396dc0..a77307a4473b 100644 --- a/arch/blackfin/kernel/ipipe.c +++ b/arch/blackfin/kernel/ipipe.c | |||
@@ -335,3 +335,70 @@ void __ipipe_enable_root_irqs_hw(void) | |||
335 | __clear_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status)); | 335 | __clear_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status)); |
336 | bfin_sti(bfin_irq_flags); | 336 | bfin_sti(bfin_irq_flags); |
337 | } | 337 | } |
338 | |||
339 | /* | ||
340 | * We could use standard atomic bitops in the following root status | ||
341 | * manipulation routines, but let's prepare for SMP support in the | ||
342 | * same move, preventing CPU migration as required. | ||
343 | */ | ||
344 | void __ipipe_stall_root(void) | ||
345 | { | ||
346 | unsigned long *p, flags; | ||
347 | |||
348 | local_irq_save_hw(flags); | ||
349 | p = &__ipipe_root_status; | ||
350 | __set_bit(IPIPE_STALL_FLAG, p); | ||
351 | local_irq_restore_hw(flags); | ||
352 | } | ||
353 | EXPORT_SYMBOL(__ipipe_stall_root); | ||
354 | |||
355 | unsigned long __ipipe_test_and_stall_root(void) | ||
356 | { | ||
357 | unsigned long *p, flags; | ||
358 | int x; | ||
359 | |||
360 | local_irq_save_hw(flags); | ||
361 | p = &__ipipe_root_status; | ||
362 | x = __test_and_set_bit(IPIPE_STALL_FLAG, p); | ||
363 | local_irq_restore_hw(flags); | ||
364 | |||
365 | return x; | ||
366 | } | ||
367 | EXPORT_SYMBOL(__ipipe_test_and_stall_root); | ||
368 | |||
369 | unsigned long __ipipe_test_root(void) | ||
370 | { | ||
371 | const unsigned long *p; | ||
372 | unsigned long flags; | ||
373 | int x; | ||
374 | |||
375 | local_irq_save_hw_smp(flags); | ||
376 | p = &__ipipe_root_status; | ||
377 | x = test_bit(IPIPE_STALL_FLAG, p); | ||
378 | local_irq_restore_hw_smp(flags); | ||
379 | |||
380 | return x; | ||
381 | } | ||
382 | EXPORT_SYMBOL(__ipipe_test_root); | ||
383 | |||
384 | void __ipipe_lock_root(void) | ||
385 | { | ||
386 | unsigned long *p, flags; | ||
387 | |||
388 | local_irq_save_hw(flags); | ||
389 | p = &__ipipe_root_status; | ||
390 | __set_bit(IPIPE_SYNCDEFER_FLAG, p); | ||
391 | local_irq_restore_hw(flags); | ||
392 | } | ||
393 | EXPORT_SYMBOL(__ipipe_lock_root); | ||
394 | |||
395 | void __ipipe_unlock_root(void) | ||
396 | { | ||
397 | unsigned long *p, flags; | ||
398 | |||
399 | local_irq_save_hw(flags); | ||
400 | p = &__ipipe_root_status; | ||
401 | __clear_bit(IPIPE_SYNCDEFER_FLAG, p); | ||
402 | local_irq_restore_hw(flags); | ||
403 | } | ||
404 | EXPORT_SYMBOL(__ipipe_unlock_root); | ||
diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index cce79d05b90b..f1036b6b9293 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c | |||
@@ -24,16 +24,6 @@ | |||
24 | #include <asm/blackfin.h> | 24 | #include <asm/blackfin.h> |
25 | #include <asm/dma.h> | 25 | #include <asm/dma.h> |
26 | 26 | ||
27 | /* Put the error code here just in case the user cares. */ | ||
28 | int gdb_bfin_errcode; | ||
29 | /* Likewise, the vector number here (since GDB only gets the signal | ||
30 | number through the usual means, and that's not very specific). */ | ||
31 | int gdb_bfin_vector = -1; | ||
32 | |||
33 | #if KGDB_MAX_NO_CPUS != 8 | ||
34 | #error change the definition of slavecpulocks | ||
35 | #endif | ||
36 | |||
37 | void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) | 27 | void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) |
38 | { | 28 | { |
39 | gdb_regs[BFIN_R0] = regs->r0; | 29 | gdb_regs[BFIN_R0] = regs->r0; |
@@ -369,13 +359,6 @@ void kgdb_roundup_cpu(int cpu, unsigned long flags) | |||
369 | } | 359 | } |
370 | #endif | 360 | #endif |
371 | 361 | ||
372 | void kgdb_post_primary_code(struct pt_regs *regs, int eVector, int err_code) | ||
373 | { | ||
374 | /* Master processor is completely in the debugger */ | ||
375 | gdb_bfin_vector = eVector; | ||
376 | gdb_bfin_errcode = err_code; | ||
377 | } | ||
378 | |||
379 | int kgdb_arch_handle_exception(int vector, int signo, | 362 | int kgdb_arch_handle_exception(int vector, int signo, |
380 | int err_code, char *remcom_in_buffer, | 363 | int err_code, char *remcom_in_buffer, |
381 | char *remcom_out_buffer, | 364 | char *remcom_out_buffer, |
diff --git a/arch/blackfin/kernel/kgdb_test.c b/arch/blackfin/kernel/kgdb_test.c index 59fc42dc5d6a..9a4b07594389 100644 --- a/arch/blackfin/kernel/kgdb_test.c +++ b/arch/blackfin/kernel/kgdb_test.c | |||
@@ -17,8 +17,9 @@ | |||
17 | 17 | ||
18 | #include <asm/blackfin.h> | 18 | #include <asm/blackfin.h> |
19 | 19 | ||
20 | /* Symbols are here for kgdb test to poke directly */ | ||
20 | static char cmdline[256]; | 21 | static char cmdline[256]; |
21 | static unsigned long len; | 22 | static size_t len; |
22 | 23 | ||
23 | #ifndef CONFIG_SMP | 24 | #ifndef CONFIG_SMP |
24 | static int num1 __attribute__((l1_data)); | 25 | static int num1 __attribute__((l1_data)); |
@@ -27,11 +28,10 @@ void kgdb_l1_test(void) __attribute__((l1_text)); | |||
27 | 28 | ||
28 | void kgdb_l1_test(void) | 29 | void kgdb_l1_test(void) |
29 | { | 30 | { |
30 | printk(KERN_ALERT "L1(before change) : data variable addr = 0x%p, data value is %d\n", &num1, num1); | 31 | pr_alert("L1(before change) : data variable addr = 0x%p, data value is %d\n", &num1, num1); |
31 | printk(KERN_ALERT "L1 : code function addr = 0x%p\n", kgdb_l1_test); | 32 | pr_alert("L1 : code function addr = 0x%p\n", kgdb_l1_test); |
32 | num1 = num1 + 10 ; | 33 | num1 = num1 + 10; |
33 | printk(KERN_ALERT "L1(after change) : data variable addr = 0x%p, data value is %d\n", &num1, num1); | 34 | pr_alert("L1(after change) : data variable addr = 0x%p, data value is %d\n", &num1, num1); |
34 | return ; | ||
35 | } | 35 | } |
36 | #endif | 36 | #endif |
37 | 37 | ||
@@ -42,11 +42,10 @@ void kgdb_l2_test(void) __attribute__((l2)); | |||
42 | 42 | ||
43 | void kgdb_l2_test(void) | 43 | void kgdb_l2_test(void) |
44 | { | 44 | { |
45 | printk(KERN_ALERT "L2(before change) : data variable addr = 0x%p, data value is %d\n", &num2, num2); | 45 | pr_alert("L2(before change) : data variable addr = 0x%p, data value is %d\n", &num2, num2); |
46 | printk(KERN_ALERT "L2 : code function addr = 0x%p\n", kgdb_l2_test); | 46 | pr_alert("L2 : code function addr = 0x%p\n", kgdb_l2_test); |
47 | num2 = num2 + 20 ; | 47 | num2 = num2 + 20; |
48 | printk(KERN_ALERT "L2(after change) : data variable addr = 0x%p, data value is %d\n", &num2, num2); | 48 | pr_alert("L2(after change) : data variable addr = 0x%p, data value is %d\n", &num2, num2); |
49 | return ; | ||
50 | } | 49 | } |
51 | 50 | ||
52 | #endif | 51 | #endif |
@@ -54,12 +53,14 @@ void kgdb_l2_test(void) | |||
54 | 53 | ||
55 | int kgdb_test(char *name, int len, int count, int z) | 54 | int kgdb_test(char *name, int len, int count, int z) |
56 | { | 55 | { |
57 | printk(KERN_ALERT "kgdb name(%d): %s, %d, %d\n", len, name, count, z); | 56 | pr_alert("kgdb name(%d): %s, %d, %d\n", len, name, count, z); |
58 | count = z; | 57 | count = z; |
59 | return count; | 58 | return count; |
60 | } | 59 | } |
61 | 60 | ||
62 | static int test_proc_output(char *buf) | 61 | static ssize_t |
62 | kgdb_test_proc_read(struct file *file, char __user *buf, | ||
63 | size_t count, loff_t *ppos) | ||
63 | { | 64 | { |
64 | kgdb_test("hello world!", 12, 0x55, 0x10); | 65 | kgdb_test("hello world!", 12, 0x55, 0x10); |
65 | #ifndef CONFIG_SMP | 66 | #ifndef CONFIG_SMP |
@@ -72,49 +73,31 @@ static int test_proc_output(char *buf) | |||
72 | return 0; | 73 | return 0; |
73 | } | 74 | } |
74 | 75 | ||
75 | static int test_read_proc(char *page, char **start, off_t off, | 76 | static ssize_t |
76 | int count, int *eof, void *data) | 77 | kgdb_test_proc_write(struct file *file, const char __user *buffer, |
78 | size_t count, loff_t *pos) | ||
77 | { | 79 | { |
78 | int len; | 80 | len = min_t(size_t, 255, count); |
79 | |||
80 | len = test_proc_output(page); | ||
81 | if (len <= off+count) | ||
82 | *eof = 1; | ||
83 | *start = page + off; | ||
84 | len -= off; | ||
85 | if (len > count) | ||
86 | len = count; | ||
87 | if (len < 0) | ||
88 | len = 0; | ||
89 | return len; | ||
90 | } | ||
91 | |||
92 | static int test_write_proc(struct file *file, const char *buffer, | ||
93 | unsigned long count, void *data) | ||
94 | { | ||
95 | if (count >= 256) | ||
96 | len = 255; | ||
97 | else | ||
98 | len = count; | ||
99 | |||
100 | memcpy(cmdline, buffer, count); | 81 | memcpy(cmdline, buffer, count); |
101 | cmdline[len] = 0; | 82 | cmdline[len] = 0; |
102 | 83 | ||
103 | return len; | 84 | return len; |
104 | } | 85 | } |
105 | 86 | ||
87 | static const struct file_operations kgdb_test_proc_fops = { | ||
88 | .owner = THIS_MODULE, | ||
89 | .read = kgdb_test_proc_read, | ||
90 | .write = kgdb_test_proc_write, | ||
91 | }; | ||
92 | |||
106 | static int __init kgdbtest_init(void) | 93 | static int __init kgdbtest_init(void) |
107 | { | 94 | { |
108 | struct proc_dir_entry *entry; | 95 | struct proc_dir_entry *entry; |
109 | 96 | ||
110 | entry = create_proc_entry("kgdbtest", 0, NULL); | 97 | entry = proc_create("kgdbtest", 0, NULL, &kgdb_test_proc_fops); |
111 | if (entry == NULL) | 98 | if (entry == NULL) |
112 | return -ENOMEM; | 99 | return -ENOMEM; |
113 | 100 | ||
114 | entry->read_proc = test_read_proc; | ||
115 | entry->write_proc = test_write_proc; | ||
116 | entry->data = NULL; | ||
117 | |||
118 | return 0; | 101 | return 0; |
119 | } | 102 | } |
120 | 103 | ||
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index 45876427eb2d..b56b0e485e0b 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c | |||
@@ -258,9 +258,12 @@ void finish_atomic_sections (struct pt_regs *regs) | |||
258 | int __user *up0 = (int __user *)regs->p0; | 258 | int __user *up0 = (int __user *)regs->p0; |
259 | 259 | ||
260 | switch (regs->pc) { | 260 | switch (regs->pc) { |
261 | default: | ||
262 | /* not in middle of an atomic step, so resume like normal */ | ||
263 | return; | ||
264 | |||
261 | case ATOMIC_XCHG32 + 2: | 265 | case ATOMIC_XCHG32 + 2: |
262 | put_user(regs->r1, up0); | 266 | put_user(regs->r1, up0); |
263 | regs->pc = ATOMIC_XCHG32 + 4; | ||
264 | break; | 267 | break; |
265 | 268 | ||
266 | case ATOMIC_CAS32 + 2: | 269 | case ATOMIC_CAS32 + 2: |
@@ -268,7 +271,6 @@ void finish_atomic_sections (struct pt_regs *regs) | |||
268 | if (regs->r0 == regs->r1) | 271 | if (regs->r0 == regs->r1) |
269 | case ATOMIC_CAS32 + 6: | 272 | case ATOMIC_CAS32 + 6: |
270 | put_user(regs->r2, up0); | 273 | put_user(regs->r2, up0); |
271 | regs->pc = ATOMIC_CAS32 + 8; | ||
272 | break; | 274 | break; |
273 | 275 | ||
274 | case ATOMIC_ADD32 + 2: | 276 | case ATOMIC_ADD32 + 2: |
@@ -276,7 +278,6 @@ void finish_atomic_sections (struct pt_regs *regs) | |||
276 | /* fall through */ | 278 | /* fall through */ |
277 | case ATOMIC_ADD32 + 4: | 279 | case ATOMIC_ADD32 + 4: |
278 | put_user(regs->r0, up0); | 280 | put_user(regs->r0, up0); |
279 | regs->pc = ATOMIC_ADD32 + 6; | ||
280 | break; | 281 | break; |
281 | 282 | ||
282 | case ATOMIC_SUB32 + 2: | 283 | case ATOMIC_SUB32 + 2: |
@@ -284,7 +285,6 @@ void finish_atomic_sections (struct pt_regs *regs) | |||
284 | /* fall through */ | 285 | /* fall through */ |
285 | case ATOMIC_SUB32 + 4: | 286 | case ATOMIC_SUB32 + 4: |
286 | put_user(regs->r0, up0); | 287 | put_user(regs->r0, up0); |
287 | regs->pc = ATOMIC_SUB32 + 6; | ||
288 | break; | 288 | break; |
289 | 289 | ||
290 | case ATOMIC_IOR32 + 2: | 290 | case ATOMIC_IOR32 + 2: |
@@ -292,7 +292,6 @@ void finish_atomic_sections (struct pt_regs *regs) | |||
292 | /* fall through */ | 292 | /* fall through */ |
293 | case ATOMIC_IOR32 + 4: | 293 | case ATOMIC_IOR32 + 4: |
294 | put_user(regs->r0, up0); | 294 | put_user(regs->r0, up0); |
295 | regs->pc = ATOMIC_IOR32 + 6; | ||
296 | break; | 295 | break; |
297 | 296 | ||
298 | case ATOMIC_AND32 + 2: | 297 | case ATOMIC_AND32 + 2: |
@@ -300,7 +299,6 @@ void finish_atomic_sections (struct pt_regs *regs) | |||
300 | /* fall through */ | 299 | /* fall through */ |
301 | case ATOMIC_AND32 + 4: | 300 | case ATOMIC_AND32 + 4: |
302 | put_user(regs->r0, up0); | 301 | put_user(regs->r0, up0); |
303 | regs->pc = ATOMIC_AND32 + 6; | ||
304 | break; | 302 | break; |
305 | 303 | ||
306 | case ATOMIC_XOR32 + 2: | 304 | case ATOMIC_XOR32 + 2: |
@@ -308,9 +306,15 @@ void finish_atomic_sections (struct pt_regs *regs) | |||
308 | /* fall through */ | 306 | /* fall through */ |
309 | case ATOMIC_XOR32 + 4: | 307 | case ATOMIC_XOR32 + 4: |
310 | put_user(regs->r0, up0); | 308 | put_user(regs->r0, up0); |
311 | regs->pc = ATOMIC_XOR32 + 6; | ||
312 | break; | 309 | break; |
313 | } | 310 | } |
311 | |||
312 | /* | ||
313 | * We've finished the atomic section, and the only thing left for | ||
314 | * userspace is to do a RTS, so we might as well handle that too | ||
315 | * since we need to update the PC anyways. | ||
316 | */ | ||
317 | regs->pc = regs->rets; | ||
314 | } | 318 | } |
315 | 319 | ||
316 | static inline | 320 | static inline |
@@ -332,12 +336,58 @@ int in_mem_const(unsigned long addr, unsigned long size, | |||
332 | { | 336 | { |
333 | return in_mem_const_off(addr, size, 0, const_addr, const_size); | 337 | return in_mem_const_off(addr, size, 0, const_addr, const_size); |
334 | } | 338 | } |
335 | #define IN_ASYNC(bnum, bctlnum) \ | 339 | #define ASYNC_ENABLED(bnum, bctlnum) \ |
336 | ({ \ | 340 | ({ \ |
337 | (bfin_read_EBIU_AMGCTL() & 0xe) < ((bnum + 1) << 1) ? -EFAULT : \ | 341 | (bfin_read_EBIU_AMGCTL() & 0xe) < ((bnum + 1) << 1) ? 0 : \ |
338 | bfin_read_EBIU_AMBCTL##bctlnum() & B##bnum##RDYEN ? -EFAULT : \ | 342 | bfin_read_EBIU_AMBCTL##bctlnum() & B##bnum##RDYEN ? 0 : \ |
339 | BFIN_MEM_ACCESS_CORE; \ | 343 | 1; \ |
340 | }) | 344 | }) |
345 | /* | ||
346 | * We can't read EBIU banks that aren't enabled or we end up hanging | ||
347 | * on the access to the async space. Make sure we validate accesses | ||
348 | * that cross async banks too. | ||
349 | * 0 - found, but unusable | ||
350 | * 1 - found & usable | ||
351 | * 2 - not found | ||
352 | */ | ||
353 | static | ||
354 | int in_async(unsigned long addr, unsigned long size) | ||
355 | { | ||
356 | if (addr >= ASYNC_BANK0_BASE && addr < ASYNC_BANK0_BASE + ASYNC_BANK0_SIZE) { | ||
357 | if (!ASYNC_ENABLED(0, 0)) | ||
358 | return 0; | ||
359 | if (addr + size <= ASYNC_BANK0_BASE + ASYNC_BANK0_SIZE) | ||
360 | return 1; | ||
361 | size -= ASYNC_BANK0_BASE + ASYNC_BANK0_SIZE - addr; | ||
362 | addr = ASYNC_BANK0_BASE + ASYNC_BANK0_SIZE; | ||
363 | } | ||
364 | if (addr >= ASYNC_BANK1_BASE && addr < ASYNC_BANK1_BASE + ASYNC_BANK1_SIZE) { | ||
365 | if (!ASYNC_ENABLED(1, 0)) | ||
366 | return 0; | ||
367 | if (addr + size <= ASYNC_BANK1_BASE + ASYNC_BANK1_SIZE) | ||
368 | return 1; | ||
369 | size -= ASYNC_BANK1_BASE + ASYNC_BANK1_SIZE - addr; | ||
370 | addr = ASYNC_BANK1_BASE + ASYNC_BANK1_SIZE; | ||
371 | } | ||
372 | if (addr >= ASYNC_BANK2_BASE && addr < ASYNC_BANK2_BASE + ASYNC_BANK2_SIZE) { | ||
373 | if (!ASYNC_ENABLED(2, 1)) | ||
374 | return 0; | ||
375 | if (addr + size <= ASYNC_BANK2_BASE + ASYNC_BANK2_SIZE) | ||
376 | return 1; | ||
377 | size -= ASYNC_BANK2_BASE + ASYNC_BANK2_SIZE - addr; | ||
378 | addr = ASYNC_BANK2_BASE + ASYNC_BANK2_SIZE; | ||
379 | } | ||
380 | if (addr >= ASYNC_BANK3_BASE && addr < ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE) { | ||
381 | if (ASYNC_ENABLED(3, 1)) | ||
382 | return 0; | ||
383 | if (addr + size <= ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE) | ||
384 | return 1; | ||
385 | return 0; | ||
386 | } | ||
387 | |||
388 | /* not within async bounds */ | ||
389 | return 2; | ||
390 | } | ||
341 | 391 | ||
342 | int bfin_mem_access_type(unsigned long addr, unsigned long size) | 392 | int bfin_mem_access_type(unsigned long addr, unsigned long size) |
343 | { | 393 | { |
@@ -374,17 +424,11 @@ int bfin_mem_access_type(unsigned long addr, unsigned long size) | |||
374 | if (addr >= SYSMMR_BASE) | 424 | if (addr >= SYSMMR_BASE) |
375 | return BFIN_MEM_ACCESS_CORE_ONLY; | 425 | return BFIN_MEM_ACCESS_CORE_ONLY; |
376 | 426 | ||
377 | /* We can't read EBIU banks that aren't enabled or we end up hanging | 427 | switch (in_async(addr, size)) { |
378 | * on the access to the async space. | 428 | case 0: return -EFAULT; |
379 | */ | 429 | case 1: return BFIN_MEM_ACCESS_CORE; |
380 | if (in_mem_const(addr, size, ASYNC_BANK0_BASE, ASYNC_BANK0_SIZE)) | 430 | case 2: /* fall through */; |
381 | return IN_ASYNC(0, 0); | 431 | } |
382 | if (in_mem_const(addr, size, ASYNC_BANK1_BASE, ASYNC_BANK1_SIZE)) | ||
383 | return IN_ASYNC(1, 0); | ||
384 | if (in_mem_const(addr, size, ASYNC_BANK2_BASE, ASYNC_BANK2_SIZE)) | ||
385 | return IN_ASYNC(2, 1); | ||
386 | if (in_mem_const(addr, size, ASYNC_BANK3_BASE, ASYNC_BANK3_SIZE)) | ||
387 | return IN_ASYNC(3, 1); | ||
388 | 432 | ||
389 | if (in_mem_const(addr, size, BOOT_ROM_START, BOOT_ROM_LENGTH)) | 433 | if (in_mem_const(addr, size, BOOT_ROM_START, BOOT_ROM_LENGTH)) |
390 | return BFIN_MEM_ACCESS_CORE; | 434 | return BFIN_MEM_ACCESS_CORE; |
@@ -401,6 +445,8 @@ __attribute__((l1_text)) | |||
401 | /* Return 1 if access to memory range is OK, 0 otherwise */ | 445 | /* Return 1 if access to memory range is OK, 0 otherwise */ |
402 | int _access_ok(unsigned long addr, unsigned long size) | 446 | int _access_ok(unsigned long addr, unsigned long size) |
403 | { | 447 | { |
448 | int aret; | ||
449 | |||
404 | if (size == 0) | 450 | if (size == 0) |
405 | return 1; | 451 | return 1; |
406 | /* Check that things do not wrap around */ | 452 | /* Check that things do not wrap around */ |
@@ -450,6 +496,11 @@ int _access_ok(unsigned long addr, unsigned long size) | |||
450 | if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH)) | 496 | if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH)) |
451 | return 1; | 497 | return 1; |
452 | #endif | 498 | #endif |
499 | |||
500 | aret = in_async(addr, size); | ||
501 | if (aret < 2) | ||
502 | return aret; | ||
503 | |||
453 | if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH)) | 504 | if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH)) |
454 | return 1; | 505 | return 1; |
455 | 506 | ||
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c index 56b0ba12175f..65567dc4b9f5 100644 --- a/arch/blackfin/kernel/ptrace.c +++ b/arch/blackfin/kernel/ptrace.c | |||
@@ -316,19 +316,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
316 | case BFIN_MEM_ACCESS_CORE_ONLY: | 316 | case BFIN_MEM_ACCESS_CORE_ONLY: |
317 | copied = access_process_vm(child, addr, &data, | 317 | copied = access_process_vm(child, addr, &data, |
318 | to_copy, 1); | 318 | to_copy, 1); |
319 | if (copied) | ||
320 | break; | ||
321 | |||
322 | /* hrm, why didn't that work ... maybe no mapping */ | ||
323 | if (addr >= FIXED_CODE_START && | ||
324 | addr + to_copy <= FIXED_CODE_END) { | ||
325 | copy_to_user_page(0, 0, 0, paddr, &data, to_copy); | ||
326 | copied = to_copy; | ||
327 | } else if (addr >= BOOT_ROM_START) { | ||
328 | memcpy(paddr, &data, to_copy); | ||
329 | copied = to_copy; | ||
330 | } | ||
331 | |||
332 | break; | 319 | break; |
333 | case BFIN_MEM_ACCESS_DMA: | 320 | case BFIN_MEM_ACCESS_DMA: |
334 | if (safe_dma_memcpy(paddr, &data, to_copy)) | 321 | if (safe_dma_memcpy(paddr, &data, to_copy)) |
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index c202a44d1416..95448ae9c43a 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
@@ -178,10 +178,10 @@ void __init bfin_cache_init(void) | |||
178 | 178 | ||
179 | void __init bfin_relocate_l1_mem(void) | 179 | void __init bfin_relocate_l1_mem(void) |
180 | { | 180 | { |
181 | unsigned long l1_code_length; | 181 | unsigned long text_l1_len = (unsigned long)_text_l1_len; |
182 | unsigned long l1_data_a_length; | 182 | unsigned long data_l1_len = (unsigned long)_data_l1_len; |
183 | unsigned long l1_data_b_length; | 183 | unsigned long data_b_l1_len = (unsigned long)_data_b_l1_len; |
184 | unsigned long l2_length; | 184 | unsigned long l2_len = (unsigned long)_l2_len; |
185 | 185 | ||
186 | early_shadow_stamp(); | 186 | early_shadow_stamp(); |
187 | 187 | ||
@@ -201,30 +201,23 @@ void __init bfin_relocate_l1_mem(void) | |||
201 | 201 | ||
202 | blackfin_dma_early_init(); | 202 | blackfin_dma_early_init(); |
203 | 203 | ||
204 | /* if necessary, copy _stext_l1 to _etext_l1 to L1 instruction SRAM */ | 204 | /* if necessary, copy L1 text to L1 instruction SRAM */ |
205 | l1_code_length = _etext_l1 - _stext_l1; | 205 | if (L1_CODE_LENGTH && text_l1_len) |
206 | if (l1_code_length) | 206 | early_dma_memcpy(_stext_l1, _text_l1_lma, text_l1_len); |
207 | early_dma_memcpy(_stext_l1, _l1_lma_start, l1_code_length); | ||
208 | 207 | ||
209 | /* if necessary, copy _sdata_l1 to _sbss_l1 to L1 data bank A SRAM */ | 208 | /* if necessary, copy L1 data to L1 data bank A SRAM */ |
210 | l1_data_a_length = _sbss_l1 - _sdata_l1; | 209 | if (L1_DATA_A_LENGTH && data_l1_len) |
211 | if (l1_data_a_length) | 210 | early_dma_memcpy(_sdata_l1, _data_l1_lma, data_l1_len); |
212 | early_dma_memcpy(_sdata_l1, _l1_lma_start + l1_code_length, l1_data_a_length); | ||
213 | 211 | ||
214 | /* if necessary, copy _sdata_b_l1 to _sbss_b_l1 to L1 data bank B SRAM */ | 212 | /* if necessary, copy L1 data B to L1 data bank B SRAM */ |
215 | l1_data_b_length = _sbss_b_l1 - _sdata_b_l1; | 213 | if (L1_DATA_B_LENGTH && data_b_l1_len) |
216 | if (l1_data_b_length) | 214 | early_dma_memcpy(_sdata_b_l1, _data_b_l1_lma, data_b_l1_len); |
217 | early_dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length + | ||
218 | l1_data_a_length, l1_data_b_length); | ||
219 | 215 | ||
220 | early_dma_memcpy_done(); | 216 | early_dma_memcpy_done(); |
221 | 217 | ||
222 | /* if necessary, copy _stext_l2 to _edata_l2 to L2 SRAM */ | 218 | /* if necessary, copy L2 text/data to L2 SRAM */ |
223 | if (L2_LENGTH != 0) { | 219 | if (L2_LENGTH && l2_len) |
224 | l2_length = _sbss_l2 - _stext_l2; | 220 | memcpy(_stext_l2, _l2_lma, l2_len); |
225 | if (l2_length) | ||
226 | memcpy(_stext_l2, _l2_lma_start, l2_length); | ||
227 | } | ||
228 | } | 221 | } |
229 | 222 | ||
230 | /* add_memory_region to memmap */ | 223 | /* add_memory_region to memmap */ |
@@ -608,11 +601,6 @@ static __init void memory_setup(void) | |||
608 | page_mask_order = get_order(3 * page_mask_nelts * sizeof(long)); | 601 | page_mask_order = get_order(3 * page_mask_nelts * sizeof(long)); |
609 | #endif | 602 | #endif |
610 | 603 | ||
611 | #if !defined(CONFIG_MTD_UCLINUX) | ||
612 | /*In case there is no valid CPLB behind memory_end make sure we don't get to close*/ | ||
613 | memory_end -= SIZE_4K; | ||
614 | #endif | ||
615 | |||
616 | init_mm.start_code = (unsigned long)_stext; | 604 | init_mm.start_code = (unsigned long)_stext; |
617 | init_mm.end_code = (unsigned long)_etext; | 605 | init_mm.end_code = (unsigned long)_etext; |
618 | init_mm.end_data = (unsigned long)_edata; | 606 | init_mm.end_data = (unsigned long)_edata; |
@@ -917,7 +905,7 @@ void __init setup_arch(char **cmdline_p) | |||
917 | 905 | ||
918 | printk(KERN_INFO "Blackfin support (C) 2004-2009 Analog Devices, Inc.\n"); | 906 | printk(KERN_INFO "Blackfin support (C) 2004-2009 Analog Devices, Inc.\n"); |
919 | if (bfin_compiled_revid() == 0xffff) | 907 | if (bfin_compiled_revid() == 0xffff) |
920 | printk(KERN_INFO "Compiled for ADSP-%s Rev any\n", CPU); | 908 | printk(KERN_INFO "Compiled for ADSP-%s Rev any, running on 0.%d\n", CPU, bfin_revid()); |
921 | else if (bfin_compiled_revid() == -1) | 909 | else if (bfin_compiled_revid() == -1) |
922 | printk(KERN_INFO "Compiled for ADSP-%s Rev none\n", CPU); | 910 | printk(KERN_INFO "Compiled for ADSP-%s Rev none\n", CPU); |
923 | else | 911 | else |
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c index 9d90c18fab23..e0fd63e9e38a 100644 --- a/arch/blackfin/kernel/signal.c +++ b/arch/blackfin/kernel/signal.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/binfmts.h> | 12 | #include <linux/binfmts.h> |
13 | #include <linux/freezer.h> | 13 | #include <linux/freezer.h> |
14 | #include <linux/uaccess.h> | 14 | #include <linux/uaccess.h> |
15 | #include <linux/tracehook.h> | ||
15 | 16 | ||
16 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
17 | #include <asm/ucontext.h> | 18 | #include <asm/ucontext.h> |
@@ -332,3 +333,20 @@ asmlinkage void do_signal(struct pt_regs *regs) | |||
332 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 333 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
333 | } | 334 | } |
334 | } | 335 | } |
336 | |||
337 | /* | ||
338 | * notification of userspace execution resumption | ||
339 | */ | ||
340 | asmlinkage void do_notify_resume(struct pt_regs *regs) | ||
341 | { | ||
342 | if (test_thread_flag(TIF_SIGPENDING) || test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
343 | do_signal(regs); | ||
344 | |||
345 | if (test_thread_flag(TIF_NOTIFY_RESUME)) { | ||
346 | clear_thread_flag(TIF_NOTIFY_RESUME); | ||
347 | tracehook_notify_resume(regs); | ||
348 | if (current->replacement_session_keyring) | ||
349 | key_replace_session_keyring(); | ||
350 | } | ||
351 | } | ||
352 | |||
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c index 359cfb1815ca..17c38c5b5b22 100644 --- a/arch/blackfin/kernel/time-ts.c +++ b/arch/blackfin/kernel/time-ts.c | |||
@@ -22,8 +22,6 @@ | |||
22 | #include <asm/time.h> | 22 | #include <asm/time.h> |
23 | #include <asm/gptimers.h> | 23 | #include <asm/gptimers.h> |
24 | 24 | ||
25 | #if defined(CONFIG_CYCLES_CLOCKSOURCE) | ||
26 | |||
27 | /* Accelerators for sched_clock() | 25 | /* Accelerators for sched_clock() |
28 | * convert from cycles(64bits) => nanoseconds (64bits) | 26 | * convert from cycles(64bits) => nanoseconds (64bits) |
29 | * basic equation: | 27 | * basic equation: |
@@ -46,20 +44,11 @@ | |||
46 | * -johnstul@us.ibm.com "math is hard, lets go shopping!" | 44 | * -johnstul@us.ibm.com "math is hard, lets go shopping!" |
47 | */ | 45 | */ |
48 | 46 | ||
49 | static unsigned long cyc2ns_scale; | ||
50 | #define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ | 47 | #define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ |
51 | 48 | ||
52 | static inline void set_cyc2ns_scale(unsigned long cpu_khz) | 49 | #if defined(CONFIG_CYCLES_CLOCKSOURCE) |
53 | { | ||
54 | cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR) / cpu_khz; | ||
55 | } | ||
56 | |||
57 | static inline unsigned long long cycles_2_ns(cycle_t cyc) | ||
58 | { | ||
59 | return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; | ||
60 | } | ||
61 | 50 | ||
62 | static cycle_t bfin_read_cycles(struct clocksource *cs) | 51 | static notrace cycle_t bfin_read_cycles(struct clocksource *cs) |
63 | { | 52 | { |
64 | return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod); | 53 | return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod); |
65 | } | 54 | } |
@@ -69,19 +58,18 @@ static struct clocksource bfin_cs_cycles = { | |||
69 | .rating = 400, | 58 | .rating = 400, |
70 | .read = bfin_read_cycles, | 59 | .read = bfin_read_cycles, |
71 | .mask = CLOCKSOURCE_MASK(64), | 60 | .mask = CLOCKSOURCE_MASK(64), |
72 | .shift = 22, | 61 | .shift = CYC2NS_SCALE_FACTOR, |
73 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 62 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
74 | }; | 63 | }; |
75 | 64 | ||
76 | unsigned long long sched_clock(void) | 65 | static inline unsigned long long bfin_cs_cycles_sched_clock(void) |
77 | { | 66 | { |
78 | return cycles_2_ns(bfin_read_cycles(&bfin_cs_cycles)); | 67 | return clocksource_cyc2ns(bfin_read_cycles(&bfin_cs_cycles), |
68 | bfin_cs_cycles.mult, bfin_cs_cycles.shift); | ||
79 | } | 69 | } |
80 | 70 | ||
81 | static int __init bfin_cs_cycles_init(void) | 71 | static int __init bfin_cs_cycles_init(void) |
82 | { | 72 | { |
83 | set_cyc2ns_scale(get_cclk() / 1000); | ||
84 | |||
85 | bfin_cs_cycles.mult = \ | 73 | bfin_cs_cycles.mult = \ |
86 | clocksource_hz2mult(get_cclk(), bfin_cs_cycles.shift); | 74 | clocksource_hz2mult(get_cclk(), bfin_cs_cycles.shift); |
87 | 75 | ||
@@ -108,7 +96,7 @@ void __init setup_gptimer0(void) | |||
108 | enable_gptimers(TIMER0bit); | 96 | enable_gptimers(TIMER0bit); |
109 | } | 97 | } |
110 | 98 | ||
111 | static cycle_t bfin_read_gptimer0(void) | 99 | static cycle_t bfin_read_gptimer0(struct clocksource *cs) |
112 | { | 100 | { |
113 | return bfin_read_TIMER0_COUNTER(); | 101 | return bfin_read_TIMER0_COUNTER(); |
114 | } | 102 | } |
@@ -118,10 +106,16 @@ static struct clocksource bfin_cs_gptimer0 = { | |||
118 | .rating = 350, | 106 | .rating = 350, |
119 | .read = bfin_read_gptimer0, | 107 | .read = bfin_read_gptimer0, |
120 | .mask = CLOCKSOURCE_MASK(32), | 108 | .mask = CLOCKSOURCE_MASK(32), |
121 | .shift = 22, | 109 | .shift = CYC2NS_SCALE_FACTOR, |
122 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 110 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
123 | }; | 111 | }; |
124 | 112 | ||
113 | static inline unsigned long long bfin_cs_gptimer0_sched_clock(void) | ||
114 | { | ||
115 | return clocksource_cyc2ns(bfin_read_TIMER0_COUNTER(), | ||
116 | bfin_cs_gptimer0.mult, bfin_cs_gptimer0.shift); | ||
117 | } | ||
118 | |||
125 | static int __init bfin_cs_gptimer0_init(void) | 119 | static int __init bfin_cs_gptimer0_init(void) |
126 | { | 120 | { |
127 | setup_gptimer0(); | 121 | setup_gptimer0(); |
@@ -138,6 +132,19 @@ static int __init bfin_cs_gptimer0_init(void) | |||
138 | # define bfin_cs_gptimer0_init() | 132 | # define bfin_cs_gptimer0_init() |
139 | #endif | 133 | #endif |
140 | 134 | ||
135 | |||
136 | #if defined(CONFIG_GPTMR0_CLOCKSOURCE) || defined(CONFIG_CYCLES_CLOCKSOURCE) | ||
137 | /* prefer to use cycles since it has higher rating */ | ||
138 | notrace unsigned long long sched_clock(void) | ||
139 | { | ||
140 | #if defined(CONFIG_CYCLES_CLOCKSOURCE) | ||
141 | return bfin_cs_cycles_sched_clock(); | ||
142 | #else | ||
143 | return bfin_cs_gptimer0_sched_clock(); | ||
144 | #endif | ||
145 | } | ||
146 | #endif | ||
147 | |||
141 | #ifdef CONFIG_CORE_TIMER_IRQ_L1 | 148 | #ifdef CONFIG_CORE_TIMER_IRQ_L1 |
142 | __attribute__((l1_text)) | 149 | __attribute__((l1_text)) |
143 | #endif | 150 | #endif |
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c index bd3b53da295e..13c1ee3e6408 100644 --- a/arch/blackfin/kernel/time.c +++ b/arch/blackfin/kernel/time.c | |||
@@ -184,11 +184,3 @@ void __init time_init(void) | |||
184 | 184 | ||
185 | time_sched_init(timer_interrupt); | 185 | time_sched_init(timer_interrupt); |
186 | } | 186 | } |
187 | |||
188 | /* | ||
189 | * Scheduler clock - returns current time in nanosec units. | ||
190 | */ | ||
191 | unsigned long long sched_clock(void) | ||
192 | { | ||
193 | return (unsigned long long)jiffies *(NSEC_PER_SEC / HZ); | ||
194 | } | ||
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 9636bace00e8..d3cbcd6bd985 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -119,6 +119,15 @@ static void decode_address(char *buf, unsigned long address) | |||
119 | return; | 119 | return; |
120 | } | 120 | } |
121 | 121 | ||
122 | /* | ||
123 | * Don't walk any of the vmas if we are oopsing, it has been known | ||
124 | * to cause problems - corrupt vmas (kernel crashes) cause double faults | ||
125 | */ | ||
126 | if (oops_in_progress) { | ||
127 | strcat(buf, "/* kernel dynamic memory (maybe user-space) */"); | ||
128 | return; | ||
129 | } | ||
130 | |||
122 | /* looks like we're off in user-land, so let's walk all the | 131 | /* looks like we're off in user-land, so let's walk all the |
123 | * mappings of all our processes and see if we can't be a whee | 132 | * mappings of all our processes and see if we can't be a whee |
124 | * bit more specific | 133 | * bit more specific |
@@ -515,6 +524,36 @@ asmlinkage notrace void trap_c(struct pt_regs *fp) | |||
515 | break; | 524 | break; |
516 | /* External Memory Addressing Error */ | 525 | /* External Memory Addressing Error */ |
517 | case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR): | 526 | case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR): |
527 | if (ANOMALY_05000310) { | ||
528 | static unsigned long anomaly_rets; | ||
529 | |||
530 | if ((fp->pc >= (L1_CODE_START + L1_CODE_LENGTH - 512)) && | ||
531 | (fp->pc < (L1_CODE_START + L1_CODE_LENGTH))) { | ||
532 | /* | ||
533 | * A false hardware error will happen while fetching at | ||
534 | * the L1 instruction SRAM boundary. Ignore it. | ||
535 | */ | ||
536 | anomaly_rets = fp->rets; | ||
537 | goto traps_done; | ||
538 | } else if (fp->rets == anomaly_rets) { | ||
539 | /* | ||
540 | * While boundary code returns to a function, at the ret | ||
541 | * point, a new false hardware error might occur too based | ||
542 | * on tests. Ignore it too. | ||
543 | */ | ||
544 | goto traps_done; | ||
545 | } else if ((fp->rets >= (L1_CODE_START + L1_CODE_LENGTH - 512)) && | ||
546 | (fp->rets < (L1_CODE_START + L1_CODE_LENGTH))) { | ||
547 | /* | ||
548 | * If boundary code calls a function, at the entry point, | ||
549 | * a new false hardware error maybe happen based on tests. | ||
550 | * Ignore it too. | ||
551 | */ | ||
552 | goto traps_done; | ||
553 | } else | ||
554 | anomaly_rets = 0; | ||
555 | } | ||
556 | |||
518 | info.si_code = BUS_ADRERR; | 557 | info.si_code = BUS_ADRERR; |
519 | sig = SIGBUS; | 558 | sig = SIGBUS; |
520 | strerror = KERN_NOTICE HWC_x3(KERN_NOTICE); | 559 | strerror = KERN_NOTICE HWC_x3(KERN_NOTICE); |
@@ -976,12 +1015,12 @@ void dump_bfin_process(struct pt_regs *fp) | |||
976 | !((unsigned long)current & 0x3) && current->pid) { | 1015 | !((unsigned long)current & 0x3) && current->pid) { |
977 | verbose_printk(KERN_NOTICE "CURRENT PROCESS:\n"); | 1016 | verbose_printk(KERN_NOTICE "CURRENT PROCESS:\n"); |
978 | if (current->comm >= (char *)FIXED_CODE_START) | 1017 | if (current->comm >= (char *)FIXED_CODE_START) |
979 | verbose_printk(KERN_NOTICE "COMM=%s PID=%d\n", | 1018 | verbose_printk(KERN_NOTICE "COMM=%s PID=%d", |
980 | current->comm, current->pid); | 1019 | current->comm, current->pid); |
981 | else | 1020 | else |
982 | verbose_printk(KERN_NOTICE "COMM= invalid\n"); | 1021 | verbose_printk(KERN_NOTICE "COMM= invalid"); |
983 | 1022 | ||
984 | printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu); | 1023 | printk(KERN_CONT " CPU=%d\n", current_thread_info()->cpu); |
985 | if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START) | 1024 | if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START) |
986 | verbose_printk(KERN_NOTICE | 1025 | verbose_printk(KERN_NOTICE |
987 | "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n" | 1026 | "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n" |
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index f39707c6590d..66799e763dc9 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S | |||
@@ -121,8 +121,6 @@ SECTIONS | |||
121 | EXIT_DATA | 121 | EXIT_DATA |
122 | } | 122 | } |
123 | 123 | ||
124 | __l1_lma_start = .; | ||
125 | |||
126 | .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data)) | 124 | .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data)) |
127 | { | 125 | { |
128 | . = ALIGN(4); | 126 | . = ALIGN(4); |
@@ -134,9 +132,11 @@ SECTIONS | |||
134 | . = ALIGN(4); | 132 | . = ALIGN(4); |
135 | __etext_l1 = .; | 133 | __etext_l1 = .; |
136 | } | 134 | } |
137 | ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!") | 135 | __text_l1_lma = LOADADDR(.text_l1); |
136 | __text_l1_len = SIZEOF(.text_l1); | ||
137 | ASSERT (__text_l1_len <= L1_CODE_LENGTH, "L1 text overflow!") | ||
138 | 138 | ||
139 | .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1)) | 139 | .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len) |
140 | { | 140 | { |
141 | . = ALIGN(4); | 141 | . = ALIGN(4); |
142 | __sdata_l1 = .; | 142 | __sdata_l1 = .; |
@@ -152,9 +152,11 @@ SECTIONS | |||
152 | . = ALIGN(4); | 152 | . = ALIGN(4); |
153 | __ebss_l1 = .; | 153 | __ebss_l1 = .; |
154 | } | 154 | } |
155 | ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!") | 155 | __data_l1_lma = LOADADDR(.data_l1); |
156 | __data_l1_len = SIZEOF(.data_l1); | ||
157 | ASSERT (__data_l1_len <= L1_DATA_A_LENGTH, "L1 data A overflow!") | ||
156 | 158 | ||
157 | .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) | 159 | .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len) |
158 | { | 160 | { |
159 | . = ALIGN(4); | 161 | . = ALIGN(4); |
160 | __sdata_b_l1 = .; | 162 | __sdata_b_l1 = .; |
@@ -167,11 +169,11 @@ SECTIONS | |||
167 | . = ALIGN(4); | 169 | . = ALIGN(4); |
168 | __ebss_b_l1 = .; | 170 | __ebss_b_l1 = .; |
169 | } | 171 | } |
170 | ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!") | 172 | __data_b_l1_lma = LOADADDR(.data_b_l1); |
171 | 173 | __data_b_l1_len = SIZEOF(.data_b_l1); | |
172 | __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); | 174 | ASSERT (__data_b_l1_len <= L1_DATA_B_LENGTH, "L1 data B overflow!") |
173 | 175 | ||
174 | .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1)) | 176 | .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len) |
175 | { | 177 | { |
176 | . = ALIGN(4); | 178 | . = ALIGN(4); |
177 | __stext_l2 = .; | 179 | __stext_l2 = .; |
@@ -193,12 +195,14 @@ SECTIONS | |||
193 | . = ALIGN(4); | 195 | . = ALIGN(4); |
194 | __ebss_l2 = .; | 196 | __ebss_l2 = .; |
195 | } | 197 | } |
196 | ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!") | 198 | __l2_lma = LOADADDR(.text_data_l2); |
199 | __l2_len = SIZEOF(.text_data_l2); | ||
200 | ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!") | ||
197 | 201 | ||
198 | /* Force trailing alignment of our init section so that when we | 202 | /* Force trailing alignment of our init section so that when we |
199 | * free our init memory, we don't leave behind a partial page. | 203 | * free our init memory, we don't leave behind a partial page. |
200 | */ | 204 | */ |
201 | . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2); | 205 | . = __l2_lma + __l2_len; |
202 | . = ALIGN(PAGE_SIZE); | 206 | . = ALIGN(PAGE_SIZE); |
203 | ___init_end = .; | 207 | ___init_end = .; |
204 | 208 | ||