1 #ifndef CYGONCE_HAL_PLATFORM_SETUP_H
2 #define CYGONCE_HAL_PLATFORM_SETUP_H
4 /*=============================================================================
6 // hal_platform_setup.h
8 // Platform specific support for HAL (assembly code)
10 //#####ECOSGPLCOPYRIGHTBEGIN####
11 //## -------------------------------------------
12 //## This file is part of eCos, the Embedded Configurable Operating System.
13 //## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15 //## eCos is free software; you can redistribute it and/or modify it under
16 //## the terms of the GNU General Public License as published by the Free
17 //## Software Foundation; either version 2 or (at your option) any later version.
19 //## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 //## WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 //## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 //## for more details.
24 //## You should have received a copy of the GNU General Public License along
25 //## with eCos; if not, write to the Free Software Foundation, Inc.,
26 //## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 //## As a special exception, if other files instantiate templates or use macros
29 //## or inline functions from this file, or you compile this file and link it
30 //## with other works to produce a work based on this file, this file does not
31 //## by itself cause the resulting work to be covered by the GNU General Public
32 //## License. However the source code for this file must still be made available
33 //## in accordance with section (3) of the GNU General Public License.
35 //## This exception does not invalidate any other reasons why a work based on
36 //## this file might be covered by the GNU General Public License.
38 //## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 //## at http://sources.redhat.com/ecos/ecos-license/
40 //## -------------------------------------------
41 //#####ECOSGPLCOPYRIGHTEND####
42 //#####DESCRIPTIONBEGIN####
44 // Author(s): usteinkohl
46 // Date: 14th January 2003
47 // Purpose: KaRo TRITON platform specific support routines
49 // Usage: #include <cyg/hal/hal_platform_setup.h>
51 //####DESCRIPTIONEND####
53 //===========================================================================*/
55 #include <pkgconf/system.h> // System-wide configuration info
56 #include CYGBLD_HAL_PLATFORM_H // Platform specific configuration
57 #include <cyg/hal/hal_triton.h> // Platform specific hardware definitions
58 #include <cyg/hal/hal_mmu.h> // MMU definitions
60 // Define macro used to diddle the LEDs during early initialization.
61 // Can use r0+r1. Argument in \x.
62 #define CYGHWR_LED_MACRO nop ;
64 // The main useful output of this file is PLATFORM_SETUP1: it invokes lots
65 // of other stuff (may depend on RAM or ROM start). The other stuff is
66 // divided into further macros to make it easier to manage what's enabled
69 #if defined(CYG_HAL_STARTUP_ROM)
70 #define PLATFORM_SETUP1 _platform_setup1
71 //#define CYGHWR_HAL_ARM_HAS_MMU
73 #define PLATFORM_SETUP1
76 #define RAM_BASE 0xa0000000
77 #define DRAM_SIZE (64*1024*1024) // max size of available SDRAM
78 #define DCACHE_SIZE (32*1024) // size of the Dcache
79 #define DCACHE_FLUSH_AREA (RAM_BASE+DRAM_SIZE) // NB: needs page table support
82 #define CPSR_IRQ_DISABLE 0x80 // IRQ disabled when =1
83 #define CPSR_FIQ_DISABLE 0x40 // FIQ disabled when =1
84 #define CPSR_FIQ_MODE 0x11
85 #define CPSR_IRQ_MODE 0x12
86 #define CPSR_SUPERVISOR_MODE 0x13
87 #define CPSR_UNDEF_MODE 0x1B
89 #define CPSR_MODE_BITS 0x1F
93 #define MMU_Control_BTB 0x800
95 // Reserved area for battery backup SDRAM memory test
96 // This area is not zeroed out by initialization code
97 #define SDRAM_BATTERY_TEST_BASE 0xA1FFFFF0 // base address of last 16 memory locations in a 32MB SDRAM
103 // Trigger the logic analyzer by writing a particular
104 // address, and triggering on that address.
105 .macro TRIGGER_LA_ON_ADDRESS address, reg0, reg1
106 mrc p15, 0, \reg0, c1, c0, 0 // read ARM control register
113 .macro DELAY_FOR cycles, reg0
115 subs \reg0, \reg0, #1
119 // wait for coprocessor write complete
121 mrc p15, 0, \reg, c2, c0, 0
126 // blink some times on GPIO10
130 ldr r1, =0x00000400 // we use GPIO10 for controlling the debug LED
133 str r1, [r0] // switch the LED on
135 ldr r2, =0x00500000 // wait some time
142 ldr r0, =GPSRx // switch the LED off
145 ldr r2, =0x00500000 // wait some time
157 .macro TRITON_SET_REFR_VAL
158 // TRITON specific, DRAM specific !!!!!!!!!!!!!
160 // Refresh period for 4096 rows = 64 ms (47 memory cycles) for 99,5 MHz MCLK
161 // DRI = 64 ms * 99,5 MHz / (4096 * 32) = 48
164 ldr r2, [r3] // read MDREFR value
166 bic r2, r2, r4 // clear out value in DRI
167 #ifdef TRITON_DRAM32_64
168 // DRI = 64 ms * 99,5 MHz / (8192 * 32) = 24 (0x18)
169 orr r2, r2, #0x00000018 // put in a valid SDRAM Refresh Interval (DRI)
171 #ifdef TRITON_DRAM16_16_MOBILE
172 // DRI = 64 ms * 99,5 MHz / (4096 * 32) = 48
173 orr r2, r2, #0x00000030 // put in a valid SDRAM Refresh Interval (DRI)
175 #ifdef TRITON_DRAM16_32_MOBILE
176 // DRI = 64 ms * 99,5 MHz / (8192 * 32) = 24
177 orr r2, r2, #0x00000018 // put in a valid SDRAM Refresh Interval (DRI)
180 str r2, [r3] // store it
184 .macro TRITON_CONFIG_SDRAM_BANKS
186 // Banks configured for 64-Mbit SDRAM devices (12(13) row x 9 col x 4 internal banks)
187 // CAS latency = 3, 32/16-bit bus width,
189 ldr r3, =MDCNFG // sdram config -- sdram should remain disabled !!!!!
191 #ifdef TRITON_DRAM32_64
192 ldr r2, =0x00000ac8 // 13 rows
194 #ifdef TRITON_DRAM16_16_MOBILE
195 ldr r2, =0x00000aac // 12 rows / 9 col / 4 banks / 16 bit / CL3
197 #ifdef TRITON_DRAM16_32_MOBILE
198 ldr r2, =0x00000acc // 13 rows / 9 col / 4 banks / 16 bit / CL3
204 // form a first-level section entry
205 .macro FL_SECTION_ENTRY base,x,ap,p,d,c,b
206 .word (\base << 20) | (\x << 12) | (\ap << 10) | (\p << 9) |\
207 (\d << 5) | (\c << 3) | (\b << 2) | 2
210 // form a first-level page table entry
211 .macro FL_PT_ENTRY base,d
212 // I wanted to use logical operations here, but since I am using symbols later
213 // to fill in the parameters, I had to use addition to force the assembler to
215 .word \base + (\d << 5) + 1
218 // form a second level small page entry
219 .macro SL_SMPAGE_ENTRY base,ap3,ap2,ap1,ap0,c,b
220 .word (\base << 12) | (\ap3 << 10) | (\ap2 << 8) | (\ap1 << 6) |\
221 (\ap0 << 4) | (\c << 3) | (\b << 2) | 2
224 // form a second level extended small page entry
225 .macro SL_XSMPAGE_ENTRY base,x,ap,c,b
226 .word (\base << 12) | (\x << 6) | (\ap << 4) | (\c << 3) | (\b << 2) | 3
229 // start of platform setup
230 .macro _platform_setup1
232 // This is where we wind up immediately after reset. On the CYCLONE, we have
233 // to jump around a hole in flash which runs from 0x00001000 - 0x0001fff.
234 // We might not have to do this for TRITON
235 // The start of _platform_setup1 will be below 0x1000 and since we need to
236 // align the mmu table on a 16k boundary, we just branch around the page
237 // table which we will locate at FLASH_BASE+0x4000.
238 b _real_platform_setup
241 // the following alignment creates the mmu table at address 0x4000.
244 // 1MB of FLASH with i80312 MMRs mapped in using 4K small pages so we can
245 // set the access permission on flash and memory-mapped registers properly.
246 FL_PT_ENTRY mmu_table_flashbase, 0
248 // Remaining 63MB of FLASH area (Static Chip select 0)
249 // rw, cacheable, non-bufferable
252 FL_SECTION_ENTRY __base, 0, 3, 0, 0, 1, 0
253 .set __base, __base+1
256 // nothing interesting here, static chip select area 1 (Address Translation)
258 FL_SECTION_ENTRY __base, 0, 3, 0, 0, 0, 0
259 .set __base, __base+1
262 // nothing interesting here, static chip select area 2 (Address Translation)
264 FL_SECTION_ENTRY __base, 0, 3, 0, 0, 0, 0
265 .set __base, __base+1
268 // nothing interesting here, static chip select area 3 (Address Translation)
270 FL_SECTION_ENTRY __base, 0, 3, 0, 0, 0, 0
271 .set __base, __base+1
274 // nothing interesting here, static chip select area 4 (Address Translation)
276 FL_SECTION_ENTRY __base, 0, 3, 0, 0, 0, 0
277 .set __base, __base+1
280 // nothing interesting here, static chip select area 5 (Address Translation)
282 FL_SECTION_ENTRY __base, 0, 3, 0, 0, 0, 0
283 .set __base, __base+1
286 // nothing interesting here (Address Translation)
288 FL_SECTION_ENTRY __base, 0, 3, 0, 0, 0, 0
289 .set __base, __base+1
294 // first 1MB mapped by second level table
295 FL_PT_ENTRY mmu_table_rambase, 0
296 .set __base, __base+1
298 // remainder of SDRAM mapped 1-to-1
300 FL_SECTION_ENTRY __base, 1, 3, 1, 0, 1, 1
301 .set __base, __base+1
304 // Cache flush region.
305 // Don't need physical memory, just a cached area.
307 FL_SECTION_ENTRY __base, 0, 3, 0, 0, 1, 1
308 .set __base, __base+1
314 .set __base, __base+1
317 // Immediately after the above table (at 0x8000) is the
318 // second level page table which breaks up the lowest 1MB
319 // of physical memory into 4KB sized virtual pages.
321 // Virtual address 0 (Flash boot code).
322 // Map 4k page at 0x00000000 virt --> 0xA0000000 physical
323 // This allows us to have a writable vector table.
324 // Read-Write, cacheable, bufferable
325 SL_XSMPAGE_ENTRY 0xa0000, 1, 3, 1, 1
327 // Virtual address 0x1000 (Memory mapped registers)
328 // Map 1-to-1, but don't cache or buffer
329 // Read-Write, non-cacheable, non-bufferable
331 SL_SMPAGE_ENTRY __base, 3, 3, 3, 3, 0, 0
332 .set __base, __base+1
334 // Virtual address 0x2000-0x100000 (remainder of flash1)
335 // Read-Write, cacheable, non-bufferable
337 SL_SMPAGE_ENTRY __base, 3, 3, 3, 3, 1, 0
338 .set __base, __base+1
341 // Now is the second level table for the first megabyte
344 // Map 4k page at 0xa0000000 virt --> 0x00000000 physical
345 // Read-Write, cacheable, non-bufferable
346 SL_SMPAGE_ENTRY 0x00000, 3, 3, 3, 3, 1, 0
347 .set __base, __base+1
349 // Map remainder of first meg of SDRAM
350 // Read-Write, cacheable, non-bufferable
353 SL_XSMPAGE_ENTRY __base, 1, 3, 1, 1
354 .set __base, __base+1
357 _real_platform_setup://Angel SDRAM init code follows
359 // if we come out of sleep mode, check if there is a pointer
360 // from the os, and jump to it if so
362 ldr r0, =RCSR // check reset source
368 ldr r2, =PSPR // check if there is a pointer from the operating system
373 ldr r3, =0x0000000f // reset RCSR
376 // get SDRAM out of Self Refresh
378 TRITON_CONFIG_SDRAM_BANKS
381 ldr r2, [r3] // read MDREFR value
382 bic r2, r2, #0x03800000 // clear all Free Running Clocks
383 orr r2, r2, #0x00010000 // assert MDREFR:K1RUN
384 bic r2, r2, #0x00020000 // clear MDREFR:K1DB2 -> SDRAM-CLK = MEMCLK
385 str r2, [r3] // change from "self-refresh and clock-stop" to "self-refresh"
386 ldr r2, [r3] // read MDREFR value (to make sure the previous value stuck) (this is in Tricia's code)
388 bic r2, r2, #0x00400000 // clear self-refresh bit
389 str r2, [r3] // change from "self-refresh" to "Power Down"
390 orr r2, r2, #0x00008000 // assert MDREFR:E1PIN
391 str r2, [r3] // change from "Power Down" to "PWRDWNX"
393 nop // no write required to change from "PWRDWNX" to "NOP"
395 ldr r3, =MDCNFG // sdram config -- sdram enable
397 orr r2, r2, #0x00000001 // enable appropriate banks
400 // initialize CPSR (machine state register)
401 mov r0, #(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_SUPERVISOR_MODE)
404 /* Set up the stack pointer to a fixed value */
408 ldr r2, =PSPR // get pointer
410 mov r15, r1 // jump to pointer
413 // must set the GPIOs up before any chip selects will work
414 //GPCRx = 0xffffffff put a 0 on any of the GPIOs (0=unchanged, 1=drive 0)
428 // GPSRx = 0x01800000 put a 1 on any of the GPIOs (0=unchanged, 1=drive 1)
431 #ifdef TRITON_CS2_SMSC
435 #ifdef TRITON_CS2_8900
443 #ifdef TRITON_USE_STUART
454 //GPDRx = 0x01800800 put the GPIOs in the correct direction (0=in, 1=out)
456 ldr r1, =0x01800000 //vorher 0x01800400
457 #ifdef TRITON_CS2_SMSC
460 #ifdef TRITON_CS2_8900
464 orr r1, r1, #0x00000800
467 orr r1, r1, #0x00000400
474 #ifdef TRITON_USE_STUART
484 //GAFR0x = 0x00000000 setup the alternate functions (00=normal, 01=alt fuct 1, etc)
487 #ifdef TRITON_CS2_SMSC
490 #ifdef TRITON_CS2_8900
495 //GAFR1x = 0x00128140
500 //GAFR0y = 0x00988050
503 #ifdef TRITON_USE_STUART
509 //GAFR1y = 0x0005aaaa
514 //GAFR0z = 0x00000000
519 //GAFR1z = 0x00000000
524 //PSSR = 0x20 clear the RDH and PH bit in the PSSR
529 ldr r3, =PCFR // clear PCFR[FS] and PCFR[FP]
531 bic r2, r2, #0x00000006
536 MRC p15, 0, r0, c0, c0, 0 // read the ID reg .... 0x69052100
537 // and display it if possible
538 // not possible for TRITON
540 // turn everything off
542 mcr p15, 0, r0, c1, c0, 0 // caches off -- MMU off or ID map
544 mcr p15, 0, R0, c7, c7, 0 // Invalidate the I & D cache, mini- d cache, and BTB
546 //MCR p15, 0, r0, c7, c5, 0 // Invalidate the instruction cache and branch target buffer
547 //MCR p15, 0, r0, c7, c6, 0 // Invalidate the data cache and mini-data cache
549 MCR p15, 0, r0, c7, c10, 4 // Drain write buffer -- r0 ignored
552 MRC p15, 0, R0, c2, c0, 0 // arbitrary read of CP15
553 MOV R0, R0 // wait for it
554 SUB PC, PC, #4 // branch to next instruction
560 // setup manager access, interrupts, etc.
561 // grant manager access to all domains
563 mcr p15, 0, r0, c3, c0, 0
564 // all IRQs should be masked to prevent spurious IRQs
565 ldr r3, =ICMR // pending interrupts are masked from becoming active
569 ldr r3, =ICLR // route all interrupts to CPU IRQ ( not to FIQ )
573 ldr r3, =ICCR // only enabled and unmasked interrupts bring core out of idle
577 // Turn on the RTC circuit (if you want)
579 ldr r1, =OSCC // oscillator config reg
580 // turn on the 32.768 KHz clock for RTC, etc.
585 ldr r3, =OSCR // reset the OS Timer Count to zero
588 ldr r4, =0x300 // really 0x2E1 is about 200usec, so 0x300 should be plenty
595 // CS0 : RDF=14(15), RDN=4 , RRR=2, 32 bits Flash
596 // Suitable for 128-Mbit StrataFlash (Tcyc = 150 ns) and 100MHz MEMCLK
597 ldr r3, =MSC0 // low - bank 0 Flash
598 #ifdef TRITON_FLASH32_32
601 #ifdef TRITON_FLASH16_16
605 #ifdef TRITON_CS2_SMSC
611 #ifdef TRITON_CS2_8900
618 ldr r2, [r3] // need to read it back to make sure the value latches (see MSC section of manual)
623 ldr r2, [r3] // need to read it back to make sure the value latches (see MSC section of manual)
628 ldr r2, [r3] // need to read it back to make sure the value latches (see MSC section of manual)
630 // ********************************************************************
631 // Disable (mask) all interrupts at the interrupt controller
633 // clear the interrupt level register (use IRQ, not FIQ)
638 // mask all interrupts at the controller
642 // make sure the DCACHE is off
643 mov r0, #0x78 // turn everything off
644 mcr p15, 0, r0, c1, c0, 0 // caches off, MMU off, etc.
649 mov r2, #0x0 // since Triton does not have SMROM, make register = 0
650 str r2, [r3] // store it
653 ldr r2, [r3] // read MDREFR value
654 bic r2, r2, #0x03800000 // clear all Free Running Clocks
655 orr r2, r2, #0x00010000 // assert MDREFR:K1RUN
656 bic r2, r2, #0x00020000 // clear MDREFR:K1DB2 -> SDRAM-CLK = MEMCLK
658 str r2, [r3] // change from "self-refresh and clock-stop" to "self-refresh"
659 ldr r2, [r3] // read MDREFR value (to make sure the previous value stuck) (this is in Tricia's code)
661 bic r2, r2, #0x00400000 // clear self-refresh bit
662 str r2, [r3] // change from "self-refresh" to "Power Down"
663 orr r2, r2, #0x00008000 // assert MDREFR:E1PIN
664 str r2, [r3] // change from "Power Down" to "PWRDWNX"
666 nop // no write required to change from "PWRDWNX" to "NOP"
668 TRITON_CONFIG_SDRAM_BANKS
671 ldr r3, =OSCR // reset the OS Timer Count to zero
674 ldr r4, =0x300 // really 0x2E1 is about 200usec, so 0x300 should be plenty
681 mov r2, #9 // now must do 8 refresh or CBR commands before the first access
682 10: // no we must do 9 because of errata 116
687 ldr r3, =MDCNFG // sdram config -- sdram enable
689 orr r2, r2, #0x00000001 // enable appropriate banks
692 ldr r3, =MDMRS // write the MDMRS
693 mov r2, #0 // the writable bits will be written as a 0 (Tricia's code writes 0x00320032)
695 #ifdef TRITON_DRAM16_16_MOBILE
700 #ifdef TRITON_DRAM16_32_MOBILE
706 ldr r3, =OSCR // reset the OS Timer Count to zero
709 ldr r4, =0x900 // really 0x2E1 is about 200usec, so 0x300 should be plenty
717 /* Set up the stack pointer to a fixed value */
721 // if we come out of sleep mode, check if there is a pointer
722 // from the os, and jump to it if so
724 ldr r0, =RCSR // check reset source
730 ldr r2, =PSPR // check if there is a pointer from the operating system
735 ldr r3, =0x0000000f // reset RCSR
738 // initialize CPSR (machine state register)
739 mov r0, #(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_SUPERVISOR_MODE)
742 mov r15, r1 // jump to pointer
749 // Change Frequency!!!
753 ldr r4, =0x145 // PxBus = 165,9 MHz MEM/LCD Clock = 165,9 MHz SDRAM-Clock 83 MHz
754 ldr r2, =CCCR // Core Clock Config Reg
755 str r4, [r2] // set speed
757 // set to Frequency Change Mode
759 mcr p14, 0, r0, c6, c0, 0 // write to the CCLKCFG coprocessor reg
760 // no TURBO-mode is set here
762 // Enable access to all coprocessor registers
763 ldr r0, =0x2001 // enable access to all coprocessors
764 mcr p15, 0, r0, c15, c1, 0
766 mcr p15, 0, r0, c7, c10, 4 // drain the write & fill buffers
769 mcr p15, 0, r0, c7, c7, 0 // flush Icache, Dcache and BTB
772 mcr p15, 0, r0, c8, c7, 0 // flush instuction and data TLBs
776 mrc p15, 0, r0, c1, c0, 0
777 orr r0, r0, #MMU_Control_I
778 mcr p15, 0, r0, c1, c0, 0
781 // Set the TTB register
783 mcr p15, 0, r0, c2, c0, 0
785 // Enable permission checks in all domains
787 mcr p15, 0, r0, c3, c0, 0
790 mrc p15, 0, r0, c1, c0, 0
791 orr r0, r0, #MMU_Control_M
792 orr r0, r0, #MMU_Control_R
793 mcr p15, 0, r0, c1, c0, 0
796 mcr p15, 0, r0, c7, c10, 4 // drain the write & fill buffers
800 mrc p15, 0, r0, c1, c0, 0
801 orr r0, r0, #MMU_Control_C
802 mcr p15, 0, r0, c1, c0, 0
806 mrc p15, 0, r0, c1, c0, 0
807 orr r0, r0, #MMU_Control_BTB
808 mcr p15, 0, r0, c1, c0, 0
811 // clean/drain/flush the main Dcache
812 mov r1, #DCACHE_FLUSH_AREA // use a CACHEABLE area of
813 // the memory map above SDRAM
814 mov r0, #1024 // number of lines in the Dcache
816 mcr p15, 0, r1, c7, c2, 5 // allocate a Dcache line
817 /* increment the address to the next cache line */
819 // decrement the loop count
820 subs r0, r0, #1 // decrement the loop count
823 // clean/drain/flush the mini Dcache
824 ldr r2, =(DCACHE_FLUSH_AREA+DCACHE_SIZE) // use a CACHEABLE area of
825 // the memory map above SDRAM
826 mov r0, #64 // number of lines in the mini Dcache
828 mcr p15, 0, r2, c7, c2, 5 // allocate a Dcache line
829 add r2, r2, #32 // increment the address to
830 // the next cache line
831 subs r0, r0, #1 // decrement the loop count
834 mcr p15, 0, r0, c7, c6, 0 // flush Dcache
837 mcr p15, 0, r0, c7, c10, 4 // drain the write & fill buffers
846 ldr r1, =hal_dram_size // [see hal_intr.h]
849 // Move mmu tables into RAM so page table walks by the cpu
850 // don't interfere with FLASH programming.
853 add r2, r0, #0x4800 // End of tables
855 orr r1, r1, #0x4000 // RAM tables
858 // first, fixup physical address to second level
859 // table used to map first 1MB of flash.
864 // everything else can go as-is
871 // go back and fixup physical address to second level
872 // table used to map first 1MB of SDRAM.
873 add r1, r5, #(0xA00 * 4)
874 ldr r0, [r1] // entry for first 1MB of DRAM
877 str r0, [r1] // store it back
880 mov r0, #DCACHE_FLUSH_AREA /* cache flush region */
881 add r1, r0, #0x8000 /* 32KB cache */
883 mcr p15, 0, r0, c7, c2, 5 /* allocate a line */
884 add r0, r0, #32 /* 32 bytes/line */
887 mcr p15, 0, r0, c7, c6, 0 /* invalidate data cache */
889 mrc p15, 0, r1, c2, c0, 0 /* arbitrary read */
892 mcr p15, 0, r0, c7, c10, 4
894 mrc p15, 0, r1, c2, c0, 0 /* arbitrary read */
899 // Set the TTB register to DRAM mmu_table
902 mcr p15, 0, r1, c7, c5, 0 // flush I cache
903 mcr p15, 0, r1, c7, c10, 4 // drain WB
904 mcr p15, 0, r0, c2, c0, 0 // load page table pointer
905 mcr p15, 0, r1, c8, c7, 0 // flush TLBs
908 //Disable software and data breakpoints
910 mcr p15, 0, r0, c14, c8, 0 // ibcr0
911 mcr p15, 0, r0, c14, c9, 0 // ibcr1
912 mcr p15, 0, r0, c14, c4, 0 // dbcon
914 //Enable all debug functionality
916 mcr p14, 0, r0, c10, c0, 0 // dcsr
919 ldr r1, =0x00000800 // we use GPIO23 for controlling the debug LED
922 str r1, [r0] // switch the LED on
924 ldr r2, =0x00500000 // wait some time
931 ldr r0, =GPSRx // switch the LED off
934 ldr r2, =0x00500000 // wait some time
946 ldr r3, =OSCR // reset the OS Timer Count to zero
949 ldr r4, =0x300 // really 0x2E1 is about 200usec, so 0x300 should be plenty
958 .endm // _platform_setup1
959 /*----------------------------------------------------------------------*/
960 /* end of hal_platform_setup.h */
961 #endif /* CYGONCE_HAL_PLATFORM_SETUP_H */