4 * Copyright (c) 2007 Embedtronics Oy
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
29 #include <sys/cdefs.h>
30 __KERNEL_RCSID(0, "$NetBSD$");
34 #include "opt_pmap_debug.h"
36 #include <sys/param.h>
37 #include <sys/device.h>
38 #include <sys/systm.h>
39 #include <sys/kernel.h>
42 #include <sys/msgbuf.h>
43 #include <sys/reboot.h>
44 #include <sys/termios.h>
45 #include <sys/ksyms.h>
47 #include <machine/bootconfig.h>
48 #include <uvm/uvm_extern.h>
52 #include <machine/db_machdep.h>
53 #include <ddb/db_sym.h>
54 #include <ddb/db_extern.h>
56 #include <machine/bus.h>
57 #include <machine/cpu.h>
58 #include <machine/frame.h>
59 #include <arm/undefined.h>
61 #include <arm/arm32/machdep.h>
62 #include <arm/cpufunc.h>
64 #include <arm/at91/at91var.h>
65 #include <arm/at91/at91busvar.h>
66 #include <arm/at91/at91dbgureg.h>
68 //#include <dev/cons.h>
69 #include <sys/termios.h>
75 #define CONSPEED B115200
79 #define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
82 int cnspeed
= CONSPEED
;
87 #define KERNEL_BASE_PHYS 0x20200000
88 #define KERNEL_TEXT_BASE (KERNEL_BASE + 0x00200000)
89 #define KERNEL_VM_BASE (KERNEL_BASE + 0x01000000)
90 #define KERNEL_VM_SIZE 0x0C000000
94 /* Define various stack sizes in pages */
95 #define IRQ_STACK_SIZE 8
96 #define ABT_STACK_SIZE 8
98 #define UND_STACK_SIZE 16
100 #define UND_STACK_SIZE 8
103 /* boot configuration: */
104 vm_offset_t physical_start
;
105 vm_offset_t physical_freestart
;
106 vm_offset_t physical_freeend
;
107 vm_offset_t physical_freeend_low
;
108 vm_offset_t physical_end
;
111 /* Physical and virtual addresses for some global pages */
115 pv_addr_t kernelstack
;
117 vm_offset_t msgbufphys
;
119 //static struct arm32_dma_range dma_ranges[4];
121 extern u_int data_abort_handler_address
;
122 extern u_int prefetch_abort_handler_address
;
123 extern u_int undefined_handler_address
;
126 extern int pmap_debug_level
;
129 #define KERNEL_PT_SYS 0 /* L2 table for mapping vectors page */
131 #define KERNEL_PT_KERNEL 1 /* L2 table for mapping kernel */
132 #define KERNEL_PT_KERNEL_NUM 4
133 /* L2 tables for mapping kernel VM */
134 #define KERNEL_PT_VMDATA (KERNEL_PT_KERNEL + KERNEL_PT_KERNEL_NUM)
136 #define KERNEL_PT_VMDATA_NUM 4 /* start with 16MB of KVM */
137 #define NUM_KERNEL_PTS (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM)
139 pv_addr_t kernel_pt_table
[NUM_KERNEL_PTS
];
143 static int at91bus_match(device_t
, cfdata_t
, void *);
144 static void at91bus_attach(device_t
, device_t
, void *);
145 static int at91bus_search(device_t
, cfdata_t
,
146 const int *, void *);
147 static int at91bus_print(void *, const char *);
148 static int at91bus_submatch(device_t
, cfdata_t
,
149 const int *, void *);
152 CFATTACH_DECL(at91bus
, sizeof(struct at91bus_softc
), at91bus_match
, at91bus_attach
, NULL
, NULL
);
154 struct at91bus_clocks at91bus_clocks
= {0};
155 struct at91bus_softc
*at91bus_sc
= NULL
;
157 #include "opt_at91types.h"
160 #include <arm/at91/at91rm9200busvar.h>
164 #include <arm/at91/at91sam9261busvar.h>
167 static const struct {
170 const struct at91bus_machdep
*machdep
;
173 DBGU_CIDR_AT91RM9200
,
180 DBGU_CIDR_AT91SAM9260
,
184 DBGU_CIDR_AT91SAM9260
,
191 DBGU_CIDR_AT91SAM9260
,
201 u_int32_t at91_chip_id
;
202 static int at91_chip_ndx
= -1;
203 struct at91bus_machdep at91bus_machdep
= { 0 };
204 at91bus_tag_t at91bus_tag
= 0;
213 cidr
= DBGUREG(DBGU_CIDR
);
217 for (i
= 0; at91_types
[i
].name
; i
++) {
218 if (cidr
== at91_types
[i
].cidr
)
228 int i
= at91_chip_ndx
= match_cid();
231 panic("%s: unknown chip", __FUNCTION__
);
233 if (!at91_types
[i
].machdep
)
234 panic("%s: %s is not supported", __FUNCTION__
, at91_types
[i
].name
);
236 memcpy(&at91bus_machdep
, at91_types
[i
].machdep
, sizeof(at91bus_machdep
));
237 at91bus_tag
= &at91bus_machdep
;
243 at91bus_setup(BootConfig
*mem
)
251 #ifdef VERBOSE_INIT_ARM
252 printf("\nNetBSD/AT91 booting ...\n");
255 // setup the CPU / MMU / TLB functions:
257 panic("%s: cpu not recognized", __FUNCTION__
);
259 #ifdef VERBOSE_INIT_ARM
260 printf("%s: configuring system...\n", __FUNCTION__
);
264 * Setup the variables that define the availability of
267 physical_start
= mem
->dram
[0].address
;
268 physical_end
= mem
->dram
[0].address
+ mem
->dram
[0].pages
* PAGE_SIZE
;
270 physical_freestart
= mem
->dram
[0].address
+ 0x9000ULL
;
271 physical_freeend
= KERNEL_BASE_PHYS
;
272 physmem
= (physical_end
- physical_start
) / PAGE_SIZE
;
274 #ifdef VERBOSE_INIT_ARM
275 printf("physmemory: %d pages at 0x%08lx -> 0x%08lx\n", physmem
,
276 physical_start
, physical_end
- 1);
279 free_pages
= (physical_freeend
- physical_freestart
) / PAGE_SIZE
;
281 #ifdef VERBOSE_INIT_ARM
282 printf("freestart = 0x%08lx, free_pages = %d (0x%08x)\n",
283 physical_freestart
, free_pages
, free_pages
);
285 /* Define a macro to simplify memory allocation */
286 #define valloc_pages(var, np) \
287 alloc_pages((var).pv_pa, (np)); \
288 (var).pv_va = KERNEL_BASE + (var).pv_pa - physical_start;
290 #define alloc_pages(var, np) \
291 physical_freeend -= ((np) * PAGE_SIZE); \
292 if (physical_freeend < physical_freestart) \
293 panic("initarm: out of memory"); \
294 (var) = physical_freeend; \
295 free_pages -= (np); \
296 memset((char *)(var), 0, ((np) * PAGE_SIZE));
299 for (loop
= 0; loop
<= NUM_KERNEL_PTS
; ++loop
) {
300 /* Are we 16KB aligned for an L1 ? */
301 if (((physical_freeend
- L1_TABLE_SIZE
) & (L1_TABLE_SIZE
- 1)) == 0
302 && kernel_l1pt
.pv_pa
== 0) {
303 valloc_pages(kernel_l1pt
, L1_TABLE_SIZE
/ PAGE_SIZE
);
305 valloc_pages(kernel_pt_table
[loop1
],
306 L2_TABLE_SIZE
/ PAGE_SIZE
);
311 /* This should never be able to happen but better confirm that. */
312 if (!kernel_l1pt
.pv_pa
|| (kernel_l1pt
.pv_pa
& (L1_TABLE_SIZE
-1)) != 0)
313 panic("initarm: Failed to align the kernel page directory");
316 * Allocate a page for the system vectors page
318 valloc_pages(systempage
, 1);
319 systempage
.pv_va
= 0x00000000;
321 /* Allocate stacks for all modes */
322 valloc_pages(irqstack
, IRQ_STACK_SIZE
);
323 valloc_pages(abtstack
, ABT_STACK_SIZE
);
324 valloc_pages(undstack
, UND_STACK_SIZE
);
325 valloc_pages(kernelstack
, UPAGES
);
327 #ifdef VERBOSE_INIT_ARM
328 printf("IRQ stack: p0x%08lx v0x%08lx\n", irqstack
.pv_pa
,
330 printf("ABT stack: p0x%08lx v0x%08lx\n", abtstack
.pv_pa
,
332 printf("UND stack: p0x%08lx v0x%08lx\n", undstack
.pv_pa
,
334 printf("SVC stack: p0x%08lx v0x%08lx\n", kernelstack
.pv_pa
,
338 alloc_pages(msgbufphys
, round_page(MSGBUFSIZE
) / PAGE_SIZE
);
341 * Ok we have allocated physical pages for the primary kernel
342 * page tables. Save physical_freeend for when we give whats left
343 * of memory below 2Mbyte to UVM.
346 physical_freeend_low
= physical_freeend
;
348 #ifdef VERBOSE_INIT_ARM
349 printf("Creating L1 page table at 0x%08lx\n", kernel_l1pt
.pv_pa
);
353 * Now we start construction of the L1 page table
354 * We start by mapping the L2 page tables into the L1.
355 * This means that we can replace L1 mappings later on if necessary
357 l1pagetable
= kernel_l1pt
.pv_pa
;
359 /* Map the L2 pages tables in the L1 page table */
360 pmap_link_l2pt(l1pagetable
, 0x00000000, &kernel_pt_table
[KERNEL_PT_SYS
]);
361 for (loop
= 0; loop
< KERNEL_PT_KERNEL_NUM
; loop
++)
362 pmap_link_l2pt(l1pagetable
, KERNEL_BASE
+ loop
* 0x00400000,
363 &kernel_pt_table
[KERNEL_PT_KERNEL
+ loop
]);
364 for (loop
= 0; loop
< KERNEL_PT_VMDATA_NUM
; loop
++)
365 pmap_link_l2pt(l1pagetable
, KERNEL_VM_BASE
+ loop
* 0x00400000,
366 &kernel_pt_table
[KERNEL_PT_VMDATA
+ loop
]);
368 /* update the top of the kernel VM */
370 KERNEL_VM_BASE
+ (KERNEL_PT_VMDATA_NUM
* 0x00400000);
372 #ifdef VERBOSE_INIT_ARM
373 printf("Mapping kernel\n");
376 /* Now we fill in the L2 pagetable for the kernel static code/data */
378 extern char etext
[], _end
[];
379 size_t textsize
= (uintptr_t) etext
- KERNEL_TEXT_BASE
;
380 size_t totalsize
= (uintptr_t) _end
- KERNEL_TEXT_BASE
;
383 textsize
= (textsize
+ PGOFSET
) & ~PGOFSET
;
384 totalsize
= (totalsize
+ PGOFSET
) & ~PGOFSET
;
386 logical
= KERNEL_BASE_PHYS
- mem
->dram
[0].address
; /* offset of kernel in RAM */
387 logical
+= pmap_map_chunk(l1pagetable
, KERNEL_BASE
+ logical
,
388 physical_start
+ logical
, textsize
,
389 VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
390 logical
+= pmap_map_chunk(l1pagetable
, KERNEL_BASE
+ logical
,
391 physical_start
+ logical
, totalsize
- textsize
,
392 VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
395 #ifdef VERBOSE_INIT_ARM
396 printf("Constructing L2 page tables\n");
399 /* Map the stack pages */
400 pmap_map_chunk(l1pagetable
, irqstack
.pv_va
, irqstack
.pv_pa
,
401 IRQ_STACK_SIZE
* PAGE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
402 pmap_map_chunk(l1pagetable
, abtstack
.pv_va
, abtstack
.pv_pa
,
403 ABT_STACK_SIZE
* PAGE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
404 pmap_map_chunk(l1pagetable
, undstack
.pv_va
, undstack
.pv_pa
,
405 UND_STACK_SIZE
* PAGE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
406 pmap_map_chunk(l1pagetable
, kernelstack
.pv_va
, kernelstack
.pv_pa
,
407 UPAGES
* PAGE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
409 pmap_map_chunk(l1pagetable
, kernel_l1pt
.pv_va
, kernel_l1pt
.pv_pa
,
410 L1_TABLE_SIZE
, VM_PROT_READ
|VM_PROT_WRITE
, PTE_PAGETABLE
);
412 for (loop
= 0; loop
< NUM_KERNEL_PTS
; ++loop
) {
413 pmap_map_chunk(l1pagetable
, kernel_pt_table
[loop
].pv_va
,
414 kernel_pt_table
[loop
].pv_pa
, L2_TABLE_SIZE
,
415 VM_PROT_READ
|VM_PROT_WRITE
, PTE_PAGETABLE
);
418 /* Map the vector page. */
419 pmap_map_entry(l1pagetable
, ARM_VECTORS_LOW
, systempage
.pv_pa
,
420 VM_PROT_READ
|VM_PROT_WRITE
, PTE_CACHE
);
422 /* Map the statically mapped devices. */
423 pmap_devmap_bootstrap(l1pagetable
, at91_devmap());
426 * Update the physical_freestart/physical_freeend/free_pages
432 physical_freestart
= physical_start
+
433 (((((uintptr_t) _end
) + PGOFSET
) & ~PGOFSET
) -
435 physical_freeend
= physical_end
;
437 (physical_freeend
- physical_freestart
) / PAGE_SIZE
;
441 * Now we have the real page tables in place so we can switch to them.
442 * Once this is done we will be running with the REAL kernel page
447 #ifdef VERBOSE_INIT_ARM
448 printf("freestart = 0x%08lx, free_pages = %d (0x%x)\n",
449 physical_freestart
, free_pages
, free_pages
);
450 printf("switching to new L1 page table @%#lx...", kernel_l1pt
.pv_pa
);
452 cpu_domains((DOMAIN_CLIENT
<< (PMAP_DOMAIN_KERNEL
*2)) | DOMAIN_CLIENT
);
453 cpu_setttb(kernel_l1pt
.pv_pa
);
455 cpu_domains(DOMAIN_CLIENT
<< (PMAP_DOMAIN_KERNEL
*2));
458 * Moved from cpu_startup() as data_abort_handler() references
459 * this during uvm init
461 uvm_lwp_setuarea(&lwp0
, kernelstack
.pv_va
);
463 #ifdef VERBOSE_INIT_ARM
467 #ifdef VERBOSE_INIT_ARM
468 printf("bootstrap done.\n");
471 /* @@@@ check this out: @@@ */
472 arm32_vector_init(ARM_VECTORS_LOW
, ARM_VEC_ALL
);
475 * Pages were allocated during the secondary bootstrap for the
476 * stacks for different CPU modes.
477 * We must now set the r13 registers in the different CPU modes to
478 * point to these stacks.
479 * Since the ARM stacks use STMFD etc. we must set r13 to the top end
480 * of the stack memory.
482 #ifdef VERBOSE_INIT_ARM
483 printf("init subsystems: stacks ");
486 set_stackptr(PSR_IRQ32_MODE
,
487 irqstack
.pv_va
+ IRQ_STACK_SIZE
* PAGE_SIZE
);
488 set_stackptr(PSR_ABT32_MODE
,
489 abtstack
.pv_va
+ ABT_STACK_SIZE
* PAGE_SIZE
);
490 set_stackptr(PSR_UND32_MODE
,
491 undstack
.pv_va
+ UND_STACK_SIZE
* PAGE_SIZE
);
494 * Well we should set a data abort handler.
495 * Once things get going this will change as we will need a proper
497 * Until then we will use a handler that just panics but tells us
499 * Initialisation of the vectors will just panic on a data abort.
500 * This just fills in a slightly better one.
502 #ifdef VERBOSE_INIT_ARM
505 data_abort_handler_address
= (u_int
)data_abort_handler
;
506 prefetch_abort_handler_address
= (u_int
)prefetch_abort_handler
;
507 undefined_handler_address
= (u_int
)undefinedinstruction_bounce
;
509 /* Initialise the undefined instruction handlers */
510 #ifdef VERBOSE_INIT_ARM
511 printf("undefined ");
515 /* Load memory into UVM. */
516 #ifdef VERBOSE_INIT_ARM
519 uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */
520 uvm_page_physload(atop(physical_freestart
), atop(physical_freeend
),
521 atop(physical_freestart
), atop(physical_freeend
),
522 VM_FREELIST_DEFAULT
);
523 uvm_page_physload(atop(physical_start
), atop(physical_freeend_low
),
524 atop(physical_start
), atop(physical_freeend_low
),
525 VM_FREELIST_DEFAULT
);
527 /* Boot strap pmap telling it where the kernel page table is */
528 #ifdef VERBOSE_INIT_ARM
531 pmap_bootstrap(KERNEL_VM_BASE
, KERNEL_VM_BASE
+ KERNEL_VM_SIZE
);
533 /* Setup the IRQ system */
534 #ifdef VERBOSE_INIT_ARM
539 #ifdef VERBOSE_INIT_ARM
544 boothowto
= BOOTHOWTO
;
546 boothowto
= AB_VERBOSE
| AB_DEBUG
; // @@@@
549 /* Initialise ipkdb */
551 if (boothowto
& RB_KDB
)
557 if (boothowto
& RB_KDB
)
561 printf("test data abort...\n");
562 *((volatile uint32_t*)(0x1234567F)) = 0xdeadbeef;
565 #ifdef VERBOSE_INIT_ARM
566 printf("%s: returning new stack pointer 0x%lX\n", __FUNCTION__
, (kernelstack
.pv_va
+ USPACE_SVC_STACK_TOP
));
569 /* We return the new stack pointer address */
570 return(kernelstack
.pv_va
+ USPACE_SVC_STACK_TOP
);
574 at91bus_match(device_t parent
, cfdata_t match
, void *aux
)
576 // we could detect the device here...
577 if (strcmp(match
->cf_name
, "at91bus") == 0)
583 at91bus_found(device_t self
, bus_addr_t addr
, int pid
)
585 int locs
[AT91BUSCF_NLOCS
];
586 struct at91bus_attach_args sa
;
587 struct at91bus_softc
*sc
;
589 memset(&locs
, 0, sizeof(locs
));
590 memset(&sa
, 0, sizeof(sa
));
592 locs
[AT91BUSCF_ADDR
] = addr
;
593 locs
[AT91BUSCF_PID
] = pid
;
595 sc
= (struct at91bus_softc
*) self
;
596 sa
.sa_iot
= sc
->sc_iot
;
597 sa
.sa_dmat
= sc
->sc_dmat
;
602 return config_found_sm_loc(self
, "at91bus", locs
, &sa
,
603 at91bus_print
, at91bus_submatch
);
607 at91bus_attach(device_t parent
, device_t self
, void *aux
)
609 struct at91bus_softc
*sc
;
611 if (at91_chip_ndx
< 0)
612 panic("%s: at91bus_init() has not been called!", __FUNCTION__
);
614 sc
= (struct at91bus_softc
*) self
;
616 /* initialize bus space and bus dma things... */
617 sc
->sc_iot
= &at91_bs_tag
;
618 sc
->sc_dmat
= at91_bus_dma_init(&at91_bd_tag
);
620 if (at91bus_sc
== NULL
)
623 printf(": %s, sclk %u.%03u kHz, mclk %u.%03u MHz, pclk %u.%03u MHz, mstclk %u.%03u, plla %u.%03u, pllb %u.%03u MHz\n",
624 at91_types
[at91_chip_ndx
].name
,
625 AT91_SCLK
/ 1000U, AT91_SCLK
% 1000U,
626 AT91_MCLK
/ 1000000U, (AT91_MCLK
/ 1000U) % 1000U,
627 AT91_PCLK
/ 1000000U, (AT91_PCLK
/ 1000U) % 1000U,
628 AT91_MSTCLK
/ 1000000U, (AT91_MSTCLK
/ 1000U) % 1000U,
629 AT91_PLLACLK
/ 1000000U, (AT91_PLLACLK
/ 1000U) % 1000U,
630 AT91_PLLBCLK
/ 1000000U, (AT91_PLLBCLK
/ 1000U) % 1000U);
635 at91_search_peripherals(self
, at91bus_found
);
638 struct at91bus_attach_args sa
;
639 memset(&sa
, 0, sizeof(sa
));
640 sa
.sa_iot
= sc
->sc_iot
;
641 sa
.sa_dmat
= sc
->sc_dmat
;
642 config_search_ia(at91bus_search
, self
, "at91bus", &sa
);
646 at91bus_submatch(device_t parent
, cfdata_t cf
, const int *ldesc
, void *aux
)
648 struct at91bus_attach_args
*sa
= aux
;
650 if (cf
->cf_loc
[AT91BUSCF_ADDR
] == ldesc
[AT91BUSCF_ADDR
]
651 && cf
->cf_loc
[AT91BUSCF_PID
] == ldesc
[AT91BUSCF_PID
]) {
652 sa
->sa_addr
= cf
->cf_loc
[AT91BUSCF_ADDR
];
653 sa
->sa_size
= cf
->cf_loc
[AT91BUSCF_SIZE
];
654 sa
->sa_pid
= cf
->cf_loc
[AT91BUSCF_PID
];
655 return (config_match(parent
, cf
, aux
));
661 at91bus_search(device_t parent
, cfdata_t cf
, const int *ldesc
, void *aux
)
663 struct at91bus_attach_args
*sa
= aux
;
665 sa
->sa_addr
= cf
->cf_loc
[AT91BUSCF_ADDR
];
666 sa
->sa_size
= cf
->cf_loc
[AT91BUSCF_SIZE
];
667 sa
->sa_pid
= cf
->cf_loc
[AT91BUSCF_PID
];
669 if (config_match(parent
, cf
, aux
) > 0)
670 config_attach(parent
, cf
, aux
, at91bus_print
);
676 at91bus_print(void *aux
, const char *name
)
678 struct at91bus_attach_args
*sa
= (struct at91bus_attach_args
*)aux
;
681 aprint_normal("%s at %s", sa
->sa_pid
>= 0 ? at91_peripheral_name(sa
->sa_pid
) : "device", name
);
684 aprint_normal(" at addr 0x%lx", sa
->sa_addr
);
686 aprint_normal("-0x%lx", sa
->sa_addr
+ sa
->sa_size
- 1);
688 aprint_normal(" pid %d", sa
->sa_pid
);
695 static int consinit_called
;
697 if (consinit_called
!= 0)
702 if (at91_chip_ndx
< 0)
703 panic("%s: at91_init() has not been called!", __FUNCTION__
);
705 // call machine specific bus initialization code
706 (*at91bus_tag
->init
)(&at91bus_clocks
);
709 (*at91bus_tag
->attach_cn
)(&at91_bs_tag
, cnspeed
, cnmode
);