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: 23th August 2004
47 // Purpose: KaRo TRITON 270 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_triton270.h> // Platform specific hardware definitions
58 #include <cyg/hal/hal_mmu.h> // MMU definitions
61 // Define macro used to diddle the LEDs during early initialization.
62 // Can use r0+r1. Argument in \x.
63 #define CYGHWR_LED_MACRO nop ;
67 // The main useful output of this file is PLATFORM_SETUP1: it invokes lots
68 // of other stuff (may depend on RAM or ROM start). The other stuff is
69 // divided into further macros to make it easier to manage what's enabled
72 #if defined(CYG_HAL_STARTUP_ROM)
73 #define PLATFORM_SETUP1 _platform_setup1
74 //#define CYGHWR_HAL_ARM_HAS_MMU
76 #define PLATFORM_SETUP1
80 #define RAM_BASE 0xa0000000
81 #define DRAM_SIZE (64*1024*1024) // max size of available SDRAM
82 #define DCACHE_SIZE (32*1024) // size of the Dcache
83 #define DCACHE_FLUSH_AREA (RAM_BASE+DRAM_SIZE) // NB: needs page table support
86 #define CPSR_IRQ_DISABLE 0x80 // IRQ disabled when =1
87 #define CPSR_FIQ_DISABLE 0x40 // FIQ disabled when =1
88 #define CPSR_FIQ_MODE 0x11
89 #define CPSR_IRQ_MODE 0x12
90 #define CPSR_SUPERVISOR_MODE 0x13
91 #define CPSR_UNDEF_MODE 0x1B
93 #define CPSR_MODE_BITS 0x1F
99 #define MMU_Control_BTB 0x800
101 // Reserved area for battery backup SDRAM memory test
102 // This area is not zeroed out by initialization code
103 #define SDRAM_BATTERY_TEST_BASE 0xA1FFFFF0 // base address of last 16 memory locations in a 32MB SDRAM
114 // macro to print a string
116 .macro PRINT_STRING_STD address
117 ldr r9, =\address // print our welcome string
123 ldr r12, [r10] // LSR
140 // Trigger the logic analyzer by writing a particular
141 // address, and triggering on that address.
142 .macro TRIGGER_LA_ON_ADDRESS address, reg0, reg1
143 mrc p15, 0, \reg0, c1, c0, 0 // read ARM control register
150 .macro DELAY_FOR cycles, reg0
152 subs \reg0, \reg0, #1
156 // wait for coprocessor write complete
158 mrc p15,0,\reg,c2,c0,0
163 // blink some times on GPIO0
169 ldr r1,=0x00000001 // we use GPIO0 for controlling the debug LED
173 str r1, [r0] // switch the LED on
176 ldr r2,=0x005 // wait some time
183 ldr r0,=GPSRa // switch the LED off
187 ldr r2,=0x005 // wait some time
206 .macro TRITON270_SET_REFR_VAL
207 // TRITON270 specific, DRAM specific !!!!!!!!!!!!!
214 ldr r2, [r3] // read MDREFR value
217 // clear out value in DRI
222 #ifdef TRITON270_DRAM32_64
223 // DRI = (64 ms * 99,5 MHz / 8192 - 31) / 32 = 23 (0x17)
224 orr r2, r2, #0x00000017 // put in a valid SDRAM Refresh Interval (DRI)
227 #ifdef TRITON270_DRAM16_32
228 // DRI = (64 ms * 99,5 MHz / 8192 - 31) / 32 = 23 (0x17)
229 orr r2, r2, #0x00000017 // put in a valid SDRAM Refresh Interval (DRI)
234 #ifdef TRITON270_DRAM32_128
235 // DRI = (64 ms * 99,5 MHz / 8192 - 31) / 32 = 23 (0x17)
236 orr r2, r2, #0x00000017 // put in a valid SDRAM Refresh Interval (DRI)
240 str r2, [r3] // store it
250 .macro TRITON270_CONFIG_SDRAM_BANKS
255 ldr r3, =MDCNFG // sdram config -- sdram should remain disabled !!!!!
265 #ifdef TRITON270_DRAM32_64
266 ldr r2, =0x08000bc8 // 13 rows / 9 col / 2 bank / 32 bit / CL3
271 #ifdef TRITON270_DRAM16_32
272 ldr r2, =0x08000bcc // 13 rows / 9 col / 2 bank / 16 bit / CL3
279 #ifdef TRITON270_DRAM16_64
280 ldr r2, =0x08000bcC // 13 rows / 9 col / 2 bank / 32 bit / CL3
286 #ifdef TRITON270_DRAM32_128
287 ldr r2, =0x88000bd0 // 13 rows / 10 col / 2 bank / 32 bit / CL3 / 1 GB Memory map
303 // form a first-level section entry
304 .macro FL_SECTION_ENTRY base,x,ap,p,d,c,b
305 .word (\base << 20) | (\x << 12) | (\ap << 10) | (\p << 9) |\
306 (\d << 5) | (\c << 3) | (\b << 2) | 2
309 // form a first-level page table entry
310 .macro FL_PT_ENTRY base,d
311 // I wanted to use logical operations here, but since I am using symbols later
312 // to fill in the parameters, I had to use addition to force the assembler to
314 .word \base + (\d << 5) + 1
317 // form a second level small page entry
318 .macro SL_SMPAGE_ENTRY base,ap3,ap2,ap1,ap0,c,b
319 .word (\base << 12) | (\ap3 << 10) | (\ap2 << 8) | (\ap1 << 6) |\
320 (\ap0 << 4) | (\c << 3) | (\b << 2) | 2
323 // form a second level extended small page entry
324 .macro SL_XSMPAGE_ENTRY base,x,ap,c,b
325 .word (\base << 12) | (\x << 6) | (\ap << 4) | (\c << 3) | (\b << 2) | 3
329 // start of platform setup
330 .macro _platform_setup1
332 // This is where we wind up immediately after reset. On the CYCLONE, we have
333 // to jump around a hole in flash which runs from 0x00001000 - 0x0001fff.
334 // The start of _platform_setup1 will be below 0x1000 and since we need to
335 // align the mmu table on a 16k boundary, we just branch around the page
336 // table which we will locate at FLASH_BASE+0x4000.
337 b _real_platform_setup
340 // the following alignment creates the mmu table at address 0x4000.
343 // 1MB of FLASH with i80312 MMRs mapped in using 4K small pages so we can
344 // set the access permission on flash and memory-mapped registers properly.
345 FL_PT_ENTRY mmu_table_flashbase,0
347 // Remaining 63MB of FLASH area (Static Chip select 0)
348 // rw, cacheable, non-bufferable
351 FL_SECTION_ENTRY __base,0,3,0,0,1,0
356 // nothing interesting here, static chip select area 1 (Address Translation)
358 FL_SECTION_ENTRY __base,0,3,0,0,0,0
363 // nothing interesting here, static chip select area 2 (Address Translation)
365 FL_SECTION_ENTRY __base,0,3,0,0,0,0
370 // nothing interesting here, static chip select area 3 (Address Translation)
372 FL_SECTION_ENTRY __base,0,3,0,0,0,0
376 // nothing interesting here, static chip select area 4 (Address Translation)
378 FL_SECTION_ENTRY __base,0,3,0,0,0,0
382 // nothing interesting here, static chip select area 5 (Address Translation)
384 FL_SECTION_ENTRY __base,0,3,0,0,0,0
390 // nothing interesting here (Address Translation)
392 FL_SECTION_ENTRY __base,0,3,0,0,0,0
404 // first 1MB mapped by second level table
405 FL_PT_ENTRY mmu_table_rambase,0
411 // remainder of SDRAM mapped 1-to-1
413 FL_SECTION_ENTRY __base,1,3,1,0,1,1
429 // Cache flush region.
430 // Don't need physical memory, just a cached area.
432 FL_SECTION_ENTRY __base,0,3,0,0,1,1
443 // Immediately after the above table (at 0x8000) is the
444 // second level page table which breaks up the lowest 1MB
445 // of physical memory into 4KB sized virtual pages.
447 // Virtual address 0 (Flash boot code).
448 // Map 4k page at 0x00000000 virt --> 0xA0000000 physical
449 // This allows us to have a writable vector table.
450 // Read-Write, cacheable, bufferable
451 SL_XSMPAGE_ENTRY 0xa0000,1,3,1,1
453 // Virtual address 0x1000 (Memory mapped registers)
454 // Map 1-to-1, but don't cache or buffer
455 // Read-Write, non-cacheable, non-bufferable
457 SL_SMPAGE_ENTRY __base,3,3,3,3,0,0
460 // Virtual address 0x2000-0x100000 (remainder of flash1)
461 // Read-Write, cacheable, non-bufferable
463 SL_SMPAGE_ENTRY __base,3,3,3,3,1,0
467 // Now is the second level table for the first megabyte
470 // Map 4k page at 0xa0000000 virt --> 0x00000000 physical
471 // Read-Write, cacheable, non-bufferable
472 SL_SMPAGE_ENTRY 0x00000,3,3,3,3,1,0
475 // Map remainder of first meg of SDRAM
476 // Read-Write, cacheable, non-bufferable
479 SL_XSMPAGE_ENTRY __base,1,3,1,1
485 _real_platform_setup://Angel SDRAM init code follows
495 // if we come out of sleep mode, check if there is a pointer
496 // from the os, and jump to it if so
498 ldr r0, =RCSR // check reset source
506 ldr r2, =PSPR // check if there is a pointer from the operating system
509 beq 1922f // wake up from deep sleep
511 //ldr r3, =0x0000000f // reset RCSR
518 orr r1, r1, #(1<<22) // enable memory controller
522 // get SDRAM out of Self Refresh
523 TRITON270_SET_REFR_VAL
524 TRITON270_CONFIG_SDRAM_BANKS
528 ldr r2, [r3] // read MDREFR value
529 bic r2, r2, #0x03800000 // clear all Free Running Clocks
530 orr r2, r2, #0x00010000 // assert MDREFR:K1RUN
532 orr r2, r2, r4 // set K0DB4, K1DB2
533 str r2, [r3] // change from "self-refresh and clock-stop" to "self-refresh"
534 ldr r2, [r3] // read MDREFR value
536 bic r2, r2, #0x00400000 // clear self-refresh bit
537 str r2, [r3] // change from "self-refresh" to "Power Down"
538 orr r2, r2, #0x00008000 // assert MDREFR:E1PIN
539 str r2, [r3] // change from "Power Down" to "PWRDWNX"
541 nop // no write required to change from "PWRDWNX" to "NOP"
546 ldr r3, =MDCNFG // sdram config -- sdram enable
548 orr r2, r2, #0x00000001 // enable appropriate banks
554 // initialize CPSR (machine state register)
555 mov r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_SUPERVISOR_MODE)
567 /* Set up the stack pointer to a fixed value */
568 ldr r3, =__setup_stack
573 ldr r2, =PSPR // get pointer
575 mov r15, r1 // jump to pointer
594 bl __hal_initio // init the IO pins
599 //PSSR = 0x20 clear the RDH and PH bit in the PSSR
608 ldr r3, =PCFR // clear PCFR[FS] and PCFR[FP]
610 bic r2, r2, #0x00000006
623 MRC p15, 0, r0, c0, c0, 0 // read the ID reg .... 0x69052100
624 // and display it if possible
625 // not possible TRITON270 SK3
629 // turn everything off
631 mcr p15, 0, r0, c1, c0, 0 // caches off -- MMU off or ID map
633 mcr p15, 0, R0, c7, c7, 0 // Invalidate the I & D cache, mini- d cache, and BTB
636 MCR p15, 0, r0, c7, c10, 4 // Drain write buffer -- r0 ignored
639 MRC p15, 0, R0, c2, c0, 0 // arbitrary read of CP15
640 MOV R0, R0 // wait for it
641 SUB PC, PC, #4 // branch to next instruction
651 // setup manager access, interrupts, etc.
653 // grant manager access to all domains
655 mcr p15, 0, r0, c3, c0, 0
658 // all IRQs should be masked to prevent spurious IRQs
659 ldr r3, =ICMR // pending interrupts are masked from becoming active
666 ldr r3, =ICLR // route all interrupts to CPU IRQ ( not to FIQ )
672 ldr r3, =ICCR // only enabled and unmasked interrupts bring core out of idle
684 // Turn on the RTC circuit (if you want)
688 ldr r1, =OSCC // oscillator config reg
689 // turn on the 32.768 KHz clock for RTC, etc.
697 ldr r3, =OSCR // reset the OS Timer Count to zero
700 ldr r4, =0x300 // really 0x2E1 is about 200usec, so 0x300 should be plenty
709 // CS0 : RDF=8, RDN=8 , RRR=2, 16 bits Flash
710 // Suitable for Flash (Tcyc = 85 ns) and 200 MHz MEMCLK
714 ldr r3, =MSC0 // low - bank 0 Flash CS0 / CS1
715 ldr r2, =0x7ff04ff8 // 16 Bit Flash
717 ldr r2, [r3] // need to read it back to make sure the value latches (see MSC section of manual)
725 ldr r3, =MSC1 // CS3 / CS2
728 ldr r2, [r3] // need to read it back to make sure the value latches (see MSC section of manual)
732 ldr r3, =MSC2 // CS5 / CS4
733 ldr r2, =0x28847ff0 //
735 ldr r2, [r3] // need to read it back to make sure the value latches (see MSC section of manual)
742 // ********************************************************************
743 // Disable (mask) all interrupts at the interrupt controller
746 // clear the interrupt level register (use IRQ, not FIQ)
754 // mask all interrupts at the controller
764 // make sure the DCACHE is off
765 mov r0, #0x78 // turn everything off
766 mcr p15, 0, r0, c1, c0, 0 // caches off, MMU off, etc.
776 TRITON270_SET_REFR_VAL
781 mov r2, #0x0 // configure the synchrounous flash memory later
790 ldr r2, [r3] // read MDREFR value
791 bic r2, r2, #0x03800000 // clear all Free Running Clocks
792 orr r2, r2, #0x00010000 // assert MDREFR:K1RUN
794 orr r2, r2, r4 // set K0DB4, K1DB2
796 str r2, [r3] // change from "self-refresh and clock-stop" to "self-refresh"
797 ldr r2, [r3] // read MDREFR value (to make sure the previous value stuck) (this is in Tricia's code)
799 bic r2, r2, #0x00400000 // clear self-refresh bit
800 str r2, [r3] // change from "self-refresh" to "Power Down"
801 orr r2, r2, #0x00008000 // assert MDREFR:E1PIN
802 str r2, [r3] // change from "Power Down" to "PWRDWNX"
804 nop // no write required to change from "PWRDWNX" to "NOP"
812 TRITON270_CONFIG_SDRAM_BANKS
820 ldr r3, =OSCR // reset the OS Timer Count to zero
823 ldr r4, =0x300 // really 0x2E1 is about 200usec, so 0x300 should be plenty
836 mov r2, #8 // now must do 8 refresh or CBR commands before the first access
844 ldr r3, =MDCNFG // sdram config -- sdram enable
846 orr r2, r2, #0x00000001 // enable appropriate banks
856 ldr r3, =MDMRS // write the MDMRS
866 ldr r3, =OSCR // reset the OS Timer Count to zero
869 ldr r4, =0x900 // really 0x2E1 is about 200usec, so 0x300 should be plenty
889 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
893 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
901 .ascii "\r\n\r\nchecking SDRAM size now \0"
907 .ascii "\r\nfailed\r\nerror, did not found the expected 32 MBytes\r\n\0"
913 .ascii "\r\nfailed\r\nerror, did not found the expected 64 MBytes\r\n\0"
921 .ascii "\r\npassed, 32 MBytes found\r\n\0"
926 .ascii "\r\npassed, 64 MBytes found\r\n\0"
943 orr r1, r1, #0x20 // enable STUART
947 // setup the standard UART
953 ldr r1, = 0x83 // enable Divisor Latch Access
961 ldr r1, = 24 // 38400 Baud
965 ldr r1, = 0x03 // set 8N1
969 ldr r0, = STFCR // enable FIFOs
977 ldr r1, =0x40 // enable UART
993 .ascii "\r\nwaking up from deep sleep mode ... \r\n\0"
999 PRINT_STRING_STD __string_dsleep
1015 PRINT_STRING_STD __string_a
1017 ldr r0, =0xa0000000 // base address
1018 ldr r1, =32 // counter
1036 ldr r0, =0xa0000000 // base address
1037 ldr r1, =0 // counter
1049 PRINT_STRING_STD __string_dot
1061 PRINT_STRING_STD __string_b
1070 PRINT_STRING_STD __string_c
1082 PRINT_STRING_STD __string_a
1084 ldr r0, =0xa0000000 // base address
1085 ldr r1, =64 // counter
1103 ldr r0, =0xa0000000 // base address
1104 ldr r1, =0 // counter
1116 PRINT_STRING_STD __string_dot
1128 PRINT_STRING_STD __string_b64
1137 PRINT_STRING_STD __string_c64
1143 #endif //#ifdef DRAM_TEST64
1162 .ascii "\r\n\r\ntesting first 64 kbytes of SDRAM now ... \0"
1167 .ascii "ok\r\n\r\n\0"
1172 .ascii "failed\r\n\r\n\0"
1180 PRINT_STRING_STD __string_a1
1182 ldr r0, =0xa0000000 // base address
1183 ldr r1, =0x10000 // counter
1197 ldr r0, =0xa0000000 // base address
1198 ldr r1, =0x10000 // counter
1208 PRINT_STRING_STD __string_a_failed
1223 PRINT_STRING_STD __string_a_ok
1237 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1244 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1247 // Change Frequency!!!
1249 // RUN=208 TURBO=208 SystemBus=208 MEMClk=208 SDRAM=104 Flash=52 LCD=104
1251 // CCCR: L=16 2N=2 A=1 CLKCFG: T=1 HT=0 B=1
1252 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1258 str r1, [r2] // set speed
1259 mov r1, #0xb // set turbo mode, set fast bus , set frequency change
1260 mov r3, r1 // save value
1261 mcr p14, 0, r1, c6, c0, 0 // frequency change sequence
1262 ldr r1, [r2] // dummy read from CCCR
1264 mrc p14, 0, r1, c6, c0, 0 // read CLKCFG
1265 cmp r3, r1 // compare it with value written
1274 // Enable access to all coprocessor registers
1275 ldr r0, =0x2001 // enable access to all coprocessors
1276 mcr p15, 0, r0, c15, c1, 0
1278 mcr p15, 0, r0, c7, c10, 4 // drain the write & fill buffers
1281 mcr p15, 0, r0, c7, c7, 0 // flush Icache, Dcache and BTB
1284 mcr p15, 0, r0, c8, c7, 0 // flush instuction and data TLBs
1290 // Enable the Icache
1291 mrc p15, 0, r0, c1, c0, 0
1292 orr r0, r0, #MMU_Control_I
1293 mcr p15, 0, r0, c1, c0, 0
1298 // Set the TTB register
1300 mcr p15, 0, r0, c2, c0, 0
1302 // Enable permission checks in all domains
1304 mcr p15, 0, r0, c3, c0, 0
1307 mrc p15, 0, r0, c1, c0, 0
1308 orr r0, r0, #MMU_Control_M
1309 orr r0, r0, #MMU_Control_R
1310 mcr p15, 0, r0, c1, c0, 0
1313 mcr p15, 0, r0, c7, c10, 4 // drain the write & fill buffers
1320 // Enable the Dcache
1321 mrc p15, 0, r0, c1, c0, 0
1322 orr r0, r0, #MMU_Control_C
1323 mcr p15, 0, r0, c1, c0, 0
1327 mrc p15, 0, r0, c1, c0, 0
1328 orr r0, r0, #MMU_Control_BTB
1329 mcr p15, 0, r0, c1, c0, 0
1333 // clean/drain/flush the main Dcache
1334 mov r1, #DCACHE_FLUSH_AREA // use a CACHEABLE area of
1335 // the memory map above SDRAM
1336 mov r0, #1024 // number of lines in the Dcache
1338 mcr p15, 0, r1, c7, c2, 5 // allocate a Dcache line
1339 /* increment the address to the next cache line */
1341 // decrement the loop count
1342 subs r0, r0, #1 // decrement the loop count
1347 // clean/drain/flush the mini Dcache
1348 ldr r2, =(DCACHE_FLUSH_AREA+DCACHE_SIZE) // use a CACHEABLE area of
1349 // the memory map above SDRAM
1350 mov r0, #64 // number of lines in the mini Dcache
1352 mcr p15, 0, r2, c7, c2, 5 // allocate a Dcache line
1353 add r2, r2, #32 // increment the address to
1354 // the next cache line
1355 subs r0, r0, #1 // decrement the loop count
1359 mcr p15, 0, r0, c7, c6, 0 // flush Dcache
1362 mcr p15, 0, r0, c7, c10, 4 // drain the write & fill buffers
1381 // !!!!!!!!!!!!!!!!!!!!!!! what is in r8 (usteinkohl)
1383 //we made it to here ok
1384 ldr r1, =hal_dram_size // [see hal_intr.h]
1391 // Move mmu tables into RAM so page table walks by the cpu
1392 // don't interfere with FLASH programming.
1395 add r2, r0, #0x4800 // End of tables
1397 orr r1, r1, #0x4000 // RAM tables
1403 // first, fixup physical address to second level
1404 // table used to map first 1MB of flash.
1409 // everything else can go as-is
1423 // go back and fixup physical address to second level
1424 // table used to map first 1MB of SDRAM.
1425 add r1, r5, #(0xA00 * 4)
1426 ldr r0, [r1] // entry for first 1MB of DRAM
1429 str r0, [r1] // store it back
1430 //we made it to here ok
1442 mov r0, #DCACHE_FLUSH_AREA /* cache flush region */
1443 add r1, r0, #0x8000 /* 32KB cache */
1445 mcr p15,0,r0,c7,c2,5 /* allocate a line */
1446 add r0, r0, #32 /* 32 bytes/line */
1449 mcr p15,0,r0,c7,c6,0 /* invalidate data cache */
1451 mrc p15,0,r1,c2,c0,0 /* arbitrary read */
1454 mcr p15,0,r0,c7,c10,4
1456 mrc p15,0,r1,c2,c0,0 /* arbitrary read */
1460 //we make it here ok
1467 // Set the TTB register to DRAM mmu_table
1470 mcr p15, 0, r1, c7, c5, 0 // flush I cache
1471 mcr p15, 0, r1, c7, c10, 4 // drain WB
1472 mcr p15, 0, r0, c2, c0, 0 // load page table pointer
1473 mcr p15, 0, r1, c8, c7, 0 // flush TLBs
1481 //Disable software and data breakpoints
1483 mcr p15,0,r0,c14,c8,0 // ibcr0
1484 mcr p15,0,r0,c14,c9,0 // ibcr1
1485 mcr p15,0,r0,c14,c4,0 // dbcon
1487 //Enable all debug functionality
1489 mcr p14,0,r0,c10,c0,0 // dcsr
1496 //---- Wait 200 usec
1497 ldr r3, =OSCR // reset the OS Timer Count to zero
1500 ldr r4, =0x300 // really 0x2E1 is about 200usec, so 0x300 should be plenty
1513 /* deactivate reset of SMC91C111 (GPIO10) */
1523 .ascii "\r\nup to now, it is ok \r\n\0"
1527 PRINT_STRING_STD __string_good_1
1531 .endm // _platform_setup1
1535 /*---------------------------------------------------------------------------*/
1536 /* end of hal_platform_setup.h */
1537 #endif /* CYGONCE_HAL_PLATFORM_SETUP_H */