Deleted Added
full compact
ar71xx_machdep.c (202849) ar71xx_machdep.c (202954)
1/*-
2 * Copyright (c) 2009 Oleksandr Tymoshenko
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009 Oleksandr Tymoshenko
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/mips/atheros/ar71xx_machdep.c 202849 2010-01-23 00:18:12Z imp $");
28__FBSDID("$FreeBSD: head/sys/mips/atheros/ar71xx_machdep.c 202954 2010-01-25 00:44:05Z gonzo $");
29
30#include <sys/param.h>
31#include <machine/cpuregs.h>
32
33#include <mips/sentry5/s5reg.h>
34
35#include "opt_ddb.h"
36

--- 15 unchanged lines hidden (view full) ---

52#include <machine/cpu.h>
53#include <machine/hwfunc.h>
54#include <machine/md_var.h>
55#include <machine/trap.h>
56#include <machine/vmparam.h>
57
58#include <mips/atheros/ar71xxreg.h>
59
29
30#include <sys/param.h>
31#include <machine/cpuregs.h>
32
33#include <mips/sentry5/s5reg.h>
34
35#include "opt_ddb.h"
36

--- 15 unchanged lines hidden (view full) ---

52#include <machine/cpu.h>
53#include <machine/hwfunc.h>
54#include <machine/md_var.h>
55#include <machine/trap.h>
56#include <machine/vmparam.h>
57
58#include <mips/atheros/ar71xxreg.h>
59
60extern int *edata;
61extern int *end;
60extern char edata[], end[];
61
62uint32_t ar711_base_mac[ETHER_ADDR_LEN];
63/* 4KB static data aread to keep a copy of the bootload env until
64 the dynamic kenv is setup */
65char boot1_env[4096];
66
67/*
68 * We get a string in from Redboot with the all the arguments together,
69 * "foo=bar bar=baz". Split them up and save in kenv.

--- 67 unchanged lines hidden (view full) ---

137{
138
139}
140
141void
142platform_start(__register_t a0 __unused, __register_t a1 __unused,
143 __register_t a2 __unused, __register_t a3 __unused)
144{
62uint32_t ar711_base_mac[ETHER_ADDR_LEN];
63/* 4KB static data aread to keep a copy of the bootload env until
64 the dynamic kenv is setup */
65char boot1_env[4096];
66
67/*
68 * We get a string in from Redboot with the all the arguments together,
69 * "foo=bar bar=baz". Split them up and save in kenv.

--- 67 unchanged lines hidden (view full) ---

137{
138
139}
140
141void
142platform_start(__register_t a0 __unused, __register_t a1 __unused,
143 __register_t a2 __unused, __register_t a3 __unused)
144{
145 vm_offset_t kernend;
146 uint64_t platform_counter_freq;
147 uint32_t reg;
148 int argc, i, count = 0;
149 char **argv, **envp;
145 uint64_t platform_counter_freq;
146 uint32_t reg;
147 int argc, i, count = 0;
148 char **argv, **envp;
149 vm_offset_t kernend;
150
150
151 /* clear the BSS and SBSS segments */
152 kernend = round_page((vm_offset_t)&end);
151 /*
152 * clear the BSS and SBSS segments, this should be first call in
153 * the function
154 */
155 kernend = (vm_offset_t)&end;
153 memset(&edata, 0, kernend - (vm_offset_t)(&edata));
154
156 memset(&edata, 0, kernend - (vm_offset_t)(&edata));
157
158 mips_postboot_fixup();
159
155 /* Initialize pcpu stuff */
156 mips_pcpu0_init();
157
158 argc = a0;
159 argv = (char**)a1;
160 envp = (char**)a2;
161 /*
162 * Protect ourselves from garbage in registers

--- 18 unchanged lines hidden (view full) ---

181 /*
182 * Just wild guess. RedBoot let us down and didn't reported
183 * memory size
184 */
185 if (realmem == 0)
186 realmem = btoc(32*1024*1024);
187
188 /* phys_avail regions are in bytes */
160 /* Initialize pcpu stuff */
161 mips_pcpu0_init();
162
163 argc = a0;
164 argv = (char**)a1;
165 envp = (char**)a2;
166 /*
167 * Protect ourselves from garbage in registers

--- 18 unchanged lines hidden (view full) ---

186 /*
187 * Just wild guess. RedBoot let us down and didn't reported
188 * memory size
189 */
190 if (realmem == 0)
191 realmem = btoc(32*1024*1024);
192
193 /* phys_avail regions are in bytes */
189 phys_avail[0] = MIPS_KSEG0_TO_PHYS((vm_offset_t)&end);
194 phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end);
190 phys_avail[1] = ctob(realmem);
191
192 physmem = realmem;
193
194 /*
195 * ns8250 uart code uses DELAY so ticker should be inititalized
196 * before cninit. And tick_init_params refers to hz, so * init_param1
197 * should be called first.

--- 67 unchanged lines hidden ---
195 phys_avail[1] = ctob(realmem);
196
197 physmem = realmem;
198
199 /*
200 * ns8250 uart code uses DELAY so ticker should be inititalized
201 * before cninit. And tick_init_params refers to hz, so * init_param1
202 * should be called first.

--- 67 unchanged lines hidden ---