xref: /freebsd/sys/arm/broadcom/bcm2835/bcm2835_machdep.c (revision 9a41df2a0e6408e9b329bbd8b9e37c2b44461a1b)
1 /*-
2  * Copyright (c) 2012 Oleksandr Tymoshenko.
3  * Copyright (c) 1994-1998 Mark Brinicombe.
4  * Copyright (c) 1994 Brini.
5  * All rights reserved.
6  *
7  * This code is derived from software written for Brini by Mark Brinicombe
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. All advertising materials mentioning features or use of this software
18  *    must display the following acknowledgement:
19  *      This product includes software developed by Brini.
20  * 4. The name of the company nor the name of the author may be used to
21  *    endorse or promote products derived from this software without specific
22  *    prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
25  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27  * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34  * SUCH DAMAGE.
35  *
36  * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45
37  */
38 
39 #include "opt_ddb.h"
40 #include "opt_platform.h"
41 #include "opt_global.h"
42 
43 #include <sys/cdefs.h>
44 __FBSDID("$FreeBSD$");
45 
46 #define _ARM32_BUS_DMA_PRIVATE
47 #include <sys/param.h>
48 #include <sys/systm.h>
49 #include <sys/sysproto.h>
50 #include <sys/signalvar.h>
51 #include <sys/imgact.h>
52 #include <sys/kernel.h>
53 #include <sys/ktr.h>
54 #include <sys/linker.h>
55 #include <sys/lock.h>
56 #include <sys/malloc.h>
57 #include <sys/mutex.h>
58 #include <sys/pcpu.h>
59 #include <sys/proc.h>
60 #include <sys/ptrace.h>
61 #include <sys/cons.h>
62 #include <sys/bio.h>
63 #include <sys/bus.h>
64 #include <sys/buf.h>
65 #include <sys/exec.h>
66 #include <sys/kdb.h>
67 #include <sys/msgbuf.h>
68 #include <machine/reg.h>
69 #include <machine/cpu.h>
70 #include <machine/fdt.h>
71 
72 #include <dev/fdt/fdt_common.h>
73 #include <dev/ofw/openfirm.h>
74 
75 #include <vm/vm.h>
76 #include <vm/pmap.h>
77 #include <vm/vm_object.h>
78 #include <vm/vm_page.h>
79 #include <vm/vm_pager.h>
80 #include <vm/vm_map.h>
81 #include <machine/pte.h>
82 #include <machine/pmap.h>
83 #include <machine/vmparam.h>
84 #include <machine/pcb.h>
85 #include <machine/undefined.h>
86 #include <machine/machdep.h>
87 #include <machine/metadata.h>
88 #include <machine/armreg.h>
89 #include <machine/bus.h>
90 #include <sys/reboot.h>
91 
92 #include <arm/broadcom/bcm2835/bcm2835_wdog.h>
93 
94 #define  DEBUG
95 #ifdef  DEBUG
96 #define debugf(fmt, args...) printf(fmt, ##args)
97 #else
98 #define debugf(fmt, args...)
99 #endif
100 
101 /* Start of address space used for bootstrap map */
102 #define DEVMAP_BOOTSTRAP_MAP_START	0xE0000000
103 
104 /*
105  * This is the number of L2 page tables required for covering max
106  * (hypothetical) memsize of 4GB and all kernel mappings (vectors, msgbuf,
107  * stacks etc.), uprounded to be divisible by 4.
108  */
109 #define KERNEL_PT_MAX	78
110 
111 extern unsigned char kernbase[];
112 extern unsigned char _etext[];
113 extern unsigned char _edata[];
114 extern unsigned char __bss_start[];
115 extern unsigned char _end[];
116 
117 #ifdef DDB
118 extern vm_offset_t ksym_start, ksym_end;
119 #endif
120 
121 extern u_int data_abort_handler_address;
122 extern u_int prefetch_abort_handler_address;
123 extern u_int undefined_handler_address;
124 
125 extern vm_offset_t pmap_bootstrap_lastaddr;
126 extern int *end;
127 
128 struct pv_addr kernel_pt_table[KERNEL_PT_MAX];
129 
130 /* Physical and virtual addresses for some global pages */
131 vm_paddr_t phys_avail[10];
132 vm_paddr_t dump_avail[4];
133 vm_offset_t physical_pages;
134 vm_offset_t pmap_bootstrap_lastaddr;
135 vm_paddr_t pmap_pa;
136 
137 const struct pmap_devmap *pmap_devmap_bootstrap_table;
138 struct pv_addr systempage;
139 struct pv_addr msgbufpv;
140 struct pv_addr irqstack;
141 struct pv_addr undstack;
142 struct pv_addr abtstack;
143 struct pv_addr kernelstack;
144 
145 static struct mem_region availmem_regions[FDT_MEM_REGIONS];
146 static int availmem_regions_sz;
147 
148 static void print_kenv(void);
149 static void print_kernel_section_addr(void);
150 
151 static void physmap_init(void);
152 static int platform_devmap_init(void);
153 
154 static char *
155 kenv_next(char *cp)
156 {
157 
158 	if (cp != NULL) {
159 		while (*cp != 0)
160 			cp++;
161 		cp++;
162 		if (*cp == 0)
163 			cp = NULL;
164 	}
165 	return (cp);
166 }
167 
168 static void
169 print_kenv(void)
170 {
171 	int len;
172 	char *cp;
173 
174 	debugf("loader passed (static) kenv:\n");
175 	if (kern_envp == NULL) {
176 		debugf(" no env, null ptr\n");
177 		return;
178 	}
179 	debugf(" kern_envp = 0x%08x\n", (uint32_t)kern_envp);
180 
181 	len = 0;
182 	for (cp = kern_envp; cp != NULL; cp = kenv_next(cp))
183 		debugf(" %x %s\n", (uint32_t)cp, cp);
184 }
185 
186 static void
187 print_kernel_section_addr(void)
188 {
189 
190 	debugf("kernel image addresses:\n");
191 	debugf(" kernbase       = 0x%08x\n", (uint32_t)kernbase);
192 	debugf(" _etext (sdata) = 0x%08x\n", (uint32_t)_etext);
193 	debugf(" _edata         = 0x%08x\n", (uint32_t)_edata);
194 	debugf(" __bss_start    = 0x%08x\n", (uint32_t)__bss_start);
195 	debugf(" _end           = 0x%08x\n", (uint32_t)_end);
196 }
197 
198 static void
199 physmap_init(void)
200 {
201 	int i, j, cnt;
202 	vm_offset_t phys_kernelend, kernload;
203 	uint32_t s, e, sz;
204 	struct mem_region *mp, *mp1;
205 
206 	phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR);
207 	kernload = KERNPHYSADDR;
208 
209 	/*
210 	 * Remove kernel physical address range from avail
211 	 * regions list. Page align all regions.
212 	 * Non-page aligned memory isn't very interesting to us.
213 	 * Also, sort the entries for ascending addresses.
214 	 */
215 	sz = 0;
216 	cnt = availmem_regions_sz;
217 	debugf("processing avail regions:\n");
218 	for (mp = availmem_regions; mp->mr_size; mp++) {
219 		s = mp->mr_start;
220 		e = mp->mr_start + mp->mr_size;
221 		debugf(" %08x-%08x -> ", s, e);
222 		/* Check whether this region holds all of the kernel. */
223 		if (s < kernload && e > phys_kernelend) {
224 			availmem_regions[cnt].mr_start = phys_kernelend;
225 			availmem_regions[cnt++].mr_size = e - phys_kernelend;
226 			e = kernload;
227 		}
228 		/* Look whether this regions starts within the kernel. */
229 		if (s >= kernload && s < phys_kernelend) {
230 			if (e <= phys_kernelend)
231 				goto empty;
232 			s = phys_kernelend;
233 		}
234 		/* Now look whether this region ends within the kernel. */
235 		if (e > kernload && e <= phys_kernelend) {
236 			if (s >= kernload) {
237 				goto empty;
238 			}
239 			e = kernload;
240 		}
241 		/* Now page align the start and size of the region. */
242 		s = round_page(s);
243 		e = trunc_page(e);
244 		if (e < s)
245 			e = s;
246 		sz = e - s;
247 		debugf("%08x-%08x = %x\n", s, e, sz);
248 
249 		/* Check whether some memory is left here. */
250 		if (sz == 0) {
251 		empty:
252 			printf("skipping\n");
253 			bcopy(mp + 1, mp,
254 			    (cnt - (mp - availmem_regions)) * sizeof(*mp));
255 			cnt--;
256 			mp--;
257 			continue;
258 		}
259 
260 		/* Do an insertion sort. */
261 		for (mp1 = availmem_regions; mp1 < mp; mp1++)
262 			if (s < mp1->mr_start)
263 				break;
264 		if (mp1 < mp) {
265 			bcopy(mp1, mp1 + 1, (char *)mp - (char *)mp1);
266 			mp1->mr_start = s;
267 			mp1->mr_size = sz;
268 		} else {
269 			mp->mr_start = s;
270 			mp->mr_size = sz;
271 		}
272 	}
273 	availmem_regions_sz = cnt;
274 
275 	/* Fill in phys_avail table, based on availmem_regions */
276 	debugf("fill in phys_avail:\n");
277 	for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) {
278 
279 		debugf(" region: 0x%08x - 0x%08x (0x%08x)\n",
280 		    availmem_regions[i].mr_start,
281 		    availmem_regions[i].mr_start + availmem_regions[i].mr_size,
282 		    availmem_regions[i].mr_size);
283 
284 		/*
285 		 * We should not map the page at PA 0x0000000, the VM can't
286 		 * handle it, as pmap_extract() == 0 means failure.
287 		 */
288 		if (availmem_regions[i].mr_start > 0 ||
289 		    availmem_regions[i].mr_size > PAGE_SIZE) {
290 			phys_avail[j] = availmem_regions[i].mr_start;
291 			if (phys_avail[j] == 0)
292 				phys_avail[j] += PAGE_SIZE;
293 			phys_avail[j + 1] = availmem_regions[i].mr_start +
294 			    availmem_regions[i].mr_size;
295 		} else
296 			j -= 2;
297 	}
298 	phys_avail[j] = 0;
299 	phys_avail[j + 1] = 0;
300 }
301 
302 void *
303 initarm(struct arm_boot_params *abp)
304 {
305 	struct pv_addr kernel_l1pt;
306 	struct pv_addr dpcpu;
307 	vm_offset_t dtbp, freemempos, l2_start, lastaddr;
308 	uint32_t memsize, l2size;
309 	void *kmdp;
310 	u_int l1pagetable;
311 	int i = 0, j = 0, err_devmap = 0;
312 
313 	lastaddr = parse_boot_param(abp);
314 	memsize = 0;
315 	set_cpufuncs();
316 
317 	/*
318 	 * Find the dtb passed in by the boot loader.
319 	 */
320 	kmdp = preload_search_by_type("elf kernel");
321 	if (kmdp != NULL)
322 		dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
323 	else
324 		dtbp = (vm_offset_t)NULL;
325 
326 #if defined(FDT_DTB_STATIC)
327 	/*
328 	 * In case the device tree blob was not retrieved (from metadata) try
329 	 * to use the statically embedded one.
330 	 */
331 	if (dtbp == (vm_offset_t)NULL)
332 		dtbp = (vm_offset_t)&fdt_static_dtb;
333 #endif
334 
335 	if (OF_install(OFW_FDT, 0) == FALSE)
336 		while (1);
337 
338 	if (OF_init((void *)dtbp) != 0)
339 		while (1);
340 
341 	/* Grab physical memory regions information from device tree. */
342 	if (fdt_get_mem_regions(availmem_regions, &availmem_regions_sz,
343 	    &memsize) != 0)
344 		while(1);
345 
346 	/* Platform-specific initialisation */
347 	pmap_bootstrap_lastaddr = initarm_lastaddr();
348 
349 	pcpu0_init();
350 
351 	/* Calculate number of L2 tables needed for mapping vm_page_array */
352 	l2size = (memsize / PAGE_SIZE) * sizeof(struct vm_page);
353 	l2size = (l2size >> L1_S_SHIFT) + 1;
354 
355 	/*
356 	 * Add one table for end of kernel map, one for stacks, msgbuf and
357 	 * L1 and L2 tables map and one for vectors map.
358 	 */
359 	l2size += 3;
360 
361 	/* Make it divisible by 4 */
362 	l2size = (l2size + 3) & ~3;
363 
364 #define KERNEL_TEXT_BASE (KERNBASE)
365 	freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK;
366 
367 	/* Define a macro to simplify memory allocation */
368 #define valloc_pages(var, np)                   \
369 	alloc_pages((var).pv_va, (np));         \
370 	(var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR);
371 
372 #define alloc_pages(var, np)			\
373 	(var) = freemempos;		\
374 	freemempos += (np * PAGE_SIZE);		\
375 	memset((char *)(var), 0, ((np) * PAGE_SIZE));
376 
377 	while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0)
378 		freemempos += PAGE_SIZE;
379 	valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE);
380 
381 	for (i = 0; i < l2size; ++i) {
382 		if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) {
383 			valloc_pages(kernel_pt_table[i],
384 			    L2_TABLE_SIZE / PAGE_SIZE);
385 			j = i;
386 		} else {
387 			kernel_pt_table[i].pv_va = kernel_pt_table[j].pv_va +
388 			    L2_TABLE_SIZE_REAL * (i - j);
389 			kernel_pt_table[i].pv_pa =
390 			    kernel_pt_table[i].pv_va - KERNVIRTADDR +
391 			    KERNPHYSADDR;
392 
393 		}
394 	}
395 	/*
396 	 * Allocate a page for the system page mapped to 0x00000000
397 	 * or 0xffff0000. This page will just contain the system vectors
398 	 * and can be shared by all processes.
399 	 */
400 	valloc_pages(systempage, 1);
401 
402 	/* Allocate dynamic per-cpu area. */
403 	valloc_pages(dpcpu, DPCPU_SIZE / PAGE_SIZE);
404 	dpcpu_init((void *)dpcpu.pv_va, 0);
405 
406 	/* Allocate stacks for all modes */
407 	valloc_pages(irqstack, (IRQ_STACK_SIZE * MAXCPU));
408 	valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU));
409 	valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU));
410 	valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU));
411 
412 	init_param1();
413 
414 	valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE);
415 
416 	/*
417 	 * Now we start construction of the L1 page table
418 	 * We start by mapping the L2 page tables into the L1.
419 	 * This means that we can replace L1 mappings later on if necessary
420 	 */
421 	l1pagetable = kernel_l1pt.pv_va;
422 
423 	/*
424 	 * Try to map as much as possible of kernel text and data using
425 	 * 1MB section mapping and for the rest of initial kernel address
426 	 * space use L2 coarse tables.
427 	 *
428 	 * Link L2 tables for mapping remainder of kernel (modulo 1MB)
429 	 * and kernel structures
430 	 */
431 	l2_start = lastaddr & ~(L1_S_OFFSET);
432 	for (i = 0 ; i < l2size - 1; i++)
433 		pmap_link_l2pt(l1pagetable, l2_start + i * L1_S_SIZE,
434 		    &kernel_pt_table[i]);
435 
436 	pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE;
437 
438 	/* Map kernel code and data */
439 	pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR,
440 	   (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK,
441 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
442 
443 
444 	/* Map L1 directory and allocated L2 page tables */
445 	pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa,
446 	    L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
447 
448 	pmap_map_chunk(l1pagetable, kernel_pt_table[0].pv_va,
449 	    kernel_pt_table[0].pv_pa,
450 	    L2_TABLE_SIZE_REAL * l2size,
451 	    VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
452 
453 	/* Map allocated DPCPU, stacks and msgbuf */
454 	pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa,
455 	    freemempos - dpcpu.pv_va,
456 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
457 
458 	/* Link and map the vector page */
459 	pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH,
460 	    &kernel_pt_table[l2size - 1]);
461 	pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa,
462 	    VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE);
463 
464 	/* Map pmap_devmap[] entries */
465 	err_devmap = platform_devmap_init();
466 	pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table);
467 
468 	cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) |
469 	    DOMAIN_CLIENT);
470 	pmap_pa = kernel_l1pt.pv_pa;
471 	setttb(kernel_l1pt.pv_pa);
472 	cpu_tlb_flushID();
473 	cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2));
474 
475 	/*
476 	 * Only after the SOC registers block is mapped we can perform device
477 	 * tree fixups, as they may attempt to read parameters from hardware.
478 	 */
479 	OF_interpret("perform-fixup", 0);
480 
481 	initarm_gpio_init();
482 
483 	cninit();
484 
485 	physmem = memsize / PAGE_SIZE;
486 
487 	debugf("initarm: console initialized\n");
488 	debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp);
489 	debugf(" boothowto = 0x%08x\n", boothowto);
490 	debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp);
491 	print_kernel_section_addr();
492 	print_kenv();
493 
494 	if (err_devmap != 0)
495 		printf("WARNING: could not fully configure devmap, error=%d\n",
496 		    err_devmap);
497 
498 	initarm_late_init();
499 
500 	/*
501 	 * Pages were allocated during the secondary bootstrap for the
502 	 * stacks for different CPU modes.
503 	 * We must now set the r13 registers in the different CPU modes to
504 	 * point to these stacks.
505 	 * Since the ARM stacks use STMFD etc. we must set r13 to the top end
506 	 * of the stack memory.
507 	 */
508 	cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE);
509 
510 	set_stackptrs(0);
511 
512 	/*
513 	 * We must now clean the cache again....
514 	 * Cleaning may be done by reading new data to displace any
515 	 * dirty data in the cache. This will have happened in setttb()
516 	 * but since we are boot strapping the addresses used for the read
517 	 * may have just been remapped and thus the cache could be out
518 	 * of sync. A re-clean after the switch will cure this.
519 	 * After booting there are no gross relocations of the kernel thus
520 	 * this problem will not occur after initarm().
521 	 */
522 	cpu_idcache_wbinv_all();
523 
524 	/* Set stack for exception handlers */
525 	data_abort_handler_address = (u_int)data_abort_handler;
526 	prefetch_abort_handler_address = (u_int)prefetch_abort_handler;
527 	undefined_handler_address = (u_int)undefinedinstruction_bounce;
528 	undefined_init();
529 
530 	init_proc0(kernelstack.pv_va);
531 
532 	arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL);
533 	arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0]));
534 	pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt);
535 	msgbufp = (void *)msgbufpv.pv_va;
536 	msgbufinit(msgbufp, msgbufsize);
537 	mutex_init();
538 
539 	/*
540 	 * Prepare map of physical memory regions available to vm subsystem.
541 	 */
542 	physmap_init();
543 
544 	/* Do basic tuning, hz etc */
545 	init_param2(physmem);
546 	kdb_init();
547 
548 	return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
549 	    sizeof(struct pcb)));
550 }
551 
552 vm_offset_t
553 initarm_lastaddr(void)
554 {
555 
556 	return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE);
557 }
558 
559 void
560 initarm_gpio_init(void)
561 {
562 }
563 
564 void
565 initarm_late_init(void)
566 {
567 }
568 
569 #define FDT_DEVMAP_MAX	(2)		// FIXME
570 static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = {
571 	{ 0, 0, 0, 0, 0, }
572 };
573 
574 
575 /*
576  * Construct pmap_devmap[] with DT-derived config data.
577  */
578 static int
579 platform_devmap_init(void)
580 {
581 	int i = 0;
582 
583 	fdt_devmap[i].pd_va = 0xf2000000;
584 	fdt_devmap[i].pd_pa = 0x20000000;
585 	fdt_devmap[i].pd_size = 0x01000000;       /* 1 MB */
586 	fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
587 	fdt_devmap[i].pd_cache = PTE_DEVICE;
588 	i++;
589 
590 	pmap_devmap_bootstrap_table = &fdt_devmap[0];
591 	return (0);
592 }
593 
594 struct arm32_dma_range *
595 bus_dma_get_range(void)
596 {
597 
598 	return (NULL);
599 }
600 
601 int
602 bus_dma_get_range_nb(void)
603 {
604 
605 	return (0);
606 }
607 
608 void
609 cpu_reset()
610 {
611 	bcmwd_watchdog_reset();
612 	while (1);
613 }
614