Commit Graph

1514 Commits

Author SHA1 Message Date
Warner Losh
1221371f4a For our at91rm9200 boards, register which subtype of SoC is on the
board.  We'll use this later to control the differences between these
two variants' pins.
2012-07-13 04:22:08 +00:00
Warner Losh
bc52deb7a9 This file is no longer AT91RM9200 specific, but now is generic to all
Atmel AT91 SoC's we support.  Rename to reflect that.
2012-07-12 19:15:38 +00:00
Warner Losh
1c882be4bc Remember where we found the DBGU and use that for our console. 2012-07-12 19:11:37 +00:00
Warner Losh
097047f652 Fix whitespace divot. 2012-07-12 13:54:24 +00:00
Warner Losh
a68d1f48b9 Complete the transition away from newbus to populate the children to
the linker set of CPU modules.  The newbus method, although clever,
had many flaws: it didn't really support multiple SoC, many of the
comments about order were just wrong, and it did a few things far too
late to be useful.  delay and cpu_reset now work much earlier in the
boot process.
2012-07-12 13:45:58 +00:00
Warner Losh
7f6eecf580 Create the children devices for the SoC in atmelarm bus node, not in
the identify routine of the CPU.
2012-07-12 04:23:11 +00:00
Warner Losh
0fb8b6b070 Export the interrupt status vector via soc_data. Set the interrupt
priorities in the AIC in the atmelarm driver before attaching the
children.  Delete redunant copies of the code.
2012-07-12 02:58:45 +00:00
Warner Losh
691b3c3238 Make the SoC stuff a little more modular, and start to move away from
having the CPU device that's a child of atmelarm that does stuff.

o Create a linker_set for the support fucntions for the SoCs.
o Rename soc_data to soc_info.
o Move the delay and reset function pointers to new soc_data struct
o Create elements for all known SoCs
o Add lookup of the SoC we found, and print a warning if it isn't one
  we know about.
2012-07-11 20:17:14 +00:00
Warner Losh
a83760ee77 at91pit->at91_pit for consistnecy with other drivers. 2012-07-11 17:11:54 +00:00
Warner Losh
f81522c98a at91$DEV->at91_$DEV to match other Atmel drivers. Also, export
at91_rst_cpu_reset.
2012-07-11 17:11:07 +00:00
Warner Losh
83f45363d0 Remove some more unused code. 2012-07-10 23:11:52 +00:00
Warner Losh
6e21b3a1b6 Go ahead and disable the interrupts for the DBGU the boot loader may
have left enabled after we detect the CPU, and remove the multiplely
copied code from the SoC modules.
2012-07-10 19:48:42 +00:00
Warner Losh
d67febb24f Remove a useless bit of indirection. On all Atmel ARM products, irq 1
is the system IRQ, so use the define for it and get on with life.
2012-07-10 15:02:29 +00:00
Warner Losh
72ee489703 Revert committal of local change accidentally swept up in r238329. 2012-07-10 14:21:25 +00:00
Warner Losh
58bcb2a9b4 Pure style mischief. at91_$DEV_ rather than at91$DEV_ to match
others.
2012-07-10 06:21:42 +00:00
Warner Losh
37620f94c0 Minor rework to eliminate at91rm9200reg.h dependency and possibly set the
stage for a detach routine (unlikely to be useful, but while I was here..)
2012-07-10 06:18:53 +00:00
Warner Losh
4a4c0f7c24 Revert last change. It was accidental. 2012-07-10 05:39:06 +00:00
Warner Losh
19f4a07329 Collapse all copies of at91_add_child into at91.c. They were
logically identical before today, and actually identical after today's
changes.
2012-07-10 04:17:49 +00:00
Warner Losh
86f2e4dc63 Missed one of the special AT91SAM9xxx_BASE defines. This should be
AT91_BASE.
2012-07-10 02:44:15 +00:00
Warner Losh
89e57ebbb5 The system IRQ is always IRQ 1. Make it so. 2012-07-10 02:39:03 +00:00
Warner Losh
9a5f8be0a7 Eliminate the AT91XXXX_BASE for each SoC. AT91_BASE is the right way
to spell this since we only have one AT91_BASE for all Atmel arm9 SoCs.
2012-07-10 02:14:50 +00:00
Warner Losh
378d88b3dc Remove some unused variables/externs that have been copied too many times... 2012-07-10 01:49:50 +00:00
Warner Losh
fcdf8255c5 Not quite ready for this yet, so comment it out. 2012-07-10 01:32:52 +00:00
Warner Losh
0d814a369c There's nothing AT91RM9200 specific about this file at all. 2012-07-10 01:13:00 +00:00
Warner Losh
8304b99a75 Create a generic way to support multiple boards within an
arm platform.  Add all the atmel boards to the ATMEL kernel for
testing purposes.  Until boot loader arg parsing of baord type
is done, this won't actually be able to do the runtime selection.
2012-07-07 05:02:39 +00:00
Marcel Moolenaar
252f780672 Fix LINT.
Obtained from:	Juniper Networks, Inc.
2012-07-05 15:23:45 +00:00
Warner Losh
ba1227af3f Create a pseudo-lint kernel for all at91 SoCs. This kernel will not
currently boot, but will serve as a good linting.  make universe could
now be altered to skip building all the other at91 kernels...
2012-07-01 06:56:41 +00:00
Warner Losh
bb64064e5d Opt-in rather than opt-out of the SoC. We don't really support
running with multiple SoCs compiled in very well anyway, so this just
wastes space.  As more and more SoCs arrive in the tree, it is better
to edit one master file that builds them all than many board files.
2012-07-01 06:34:17 +00:00
Marius Strobl
478f9295ef Exclude at91sam9x25 support, which just wastes space for Ethernut 5. 2012-06-30 14:48:52 +00:00
Warner Losh
c2353ed4c0 Tweak comment. 2012-06-29 06:06:19 +00:00
Warner Losh
5cb96b1dbd Add PIOD, make at91sam9x25 a standard SoC, tweak some comments. 2012-06-29 06:05:44 +00:00
Warner Losh
65b1f169a4 Ooops, replaced the at91sam9g20 interrupt list with the at91sam9x25 ones. 2012-06-29 04:49:50 +00:00
Warner Losh
007c69d506 Initital support for AT91SAM9X25 SoC and the SAM9X25-EK evaluation
board.  Much work remains.
2012-06-29 04:18:52 +00:00
Warner Losh
53edbb2cfe All xscale ports are armeb, so mark it here. This should reduce universe
times a little.
2012-06-29 04:13:31 +00:00
Andrew Turner
74dc547e24 Make the wchar_t type machine dependent.
This is required for ARM EABI. Section 7.1.1 of the Procedure Call for the
ARM Architecture (AAPCS) defines wchar_t as either an unsigned int or an
unsigned short with the former preferred.

Because of this requirement we need to move the definition of __wchar_t to
a machine dependent header. It also cleans up the macros defining the limits
of wchar_t by defining __WCHAR_MIN and __WCHAR_MAX in the same machine
dependent header then using them to define WCHAR_MIN and WCHAR_MAX
respectively.

Discussed with:	bde
2012-06-24 04:15:58 +00:00
Konstantin Belousov
aea810386d Implement mechanism to export some kernel timekeeping data to
usermode, using shared page.  The structures and functions have vdso
prefix, to indicate the intended location of the code in some future.

The versioned per-algorithm data is exported in the format of struct
vdso_timehands, which mostly repeats the content of in-kernel struct
timehands. Usermode reading of the structure can be lockless.
Compatibility export for 32bit processes on 64bit host is also
provided. Kernel also provides usermode with indication about
currently used timecounter, so that libc can fall back to syscall if
configured timecounter is unknown to usermode code.

The shared data updates are initiated both from the tc_windup(), where
a fast task is queued to do the update, and from sysctl handlers which
change timecounter. A manual override switch
kern.timecounter.fast_gettime allows to turn off the mechanism.

Only x86 architectures export the real algorithm data, and there, only
for tsc timecounter. HPET counters page could be exported as well, but
I prefer to not further glue the kernel and libc ABI there until
proper vdso-based solution is developed.

Minimal stubs neccessary for non-x86 architectures to still compile
are provided.

Discussed with:	bde
Reviewed by:	jhb
Tested by:	flo
MFC after:	1 month
2012-06-22 07:06:40 +00:00
Warner Losh
5af29dd303 Fix a stray debug that I committed accidentally years ago... 2012-06-22 06:44:22 +00:00
Konstantin Belousov
232aa31fb9 Reserve AT_TIMEKEEP auxv entry for providing usermode the pointer to
timekeeping information.

MFC after:  1 week
2012-06-22 06:38:31 +00:00
Warner Losh
2403db9a0f Move these #defines to at91reg.h (where I should have put them in the
first place).
2012-06-22 05:54:34 +00:00
Marius Strobl
e1020aef06 Revert the part of r236495 that introduced checking of SPI_SR_TXEMPTY
for TX transfer completion as for reasons unknown this occasionally
causes SPI_SR_RXBUFF and SPI_SR_ENDRX to not rise.
In any case, once the RX part of the transfer is done it's obvious
that the preceding TX part had finished and checking of SPI_SR_TXEMPTY
was introduced to rule out a possible cause for the data corruption
mentioned in r236495 but which didn't turn out to be the problem
anyway.

MFC after:	3 days
2012-06-18 20:14:42 +00:00
Marius Strobl
da20f734c0 Try to bring this file closer to style(9). 2012-06-18 19:47:25 +00:00
Marius Strobl
352a43b07f Unbreak after r236658 by comparing the right things. 2012-06-18 19:22:10 +00:00
Alan Cox
6031c68de4 The page flag PGA_WRITEABLE is set and cleared exclusively by the pmap
layer, but it is read directly by the MI VM layer.  This change introduces
pmap_page_is_write_mapped() in order to completely encapsulate all direct
access to PGA_WRITEABLE in the pmap layer.

Aesthetics aside, I am making this change because amd64 will likely begin
using an alternative method to track write mappings, and having
pmap_page_is_write_mapped() in place allows me to make such a change
without further modification to the MI VM layer.

As an added bonus, tidy up some nearby comments concerning page flags.

Reviewed by:	kib
MFC after:	6 weeks
2012-06-16 18:56:19 +00:00
Warner Losh
6212b9963b Throw this debug behind bootverbose. The information isn't all that
exciting once the initial board bring up is over.
2012-06-16 04:34:46 +00:00
Warner Losh
d94f5b01c2 Remove stray line from merge. 2012-06-15 16:50:32 +00:00
Warner Losh
b44f8e5e1e Make it possible to link together a sam and an rm kernel. The results
aren't very pretty yet, but this takes DELAY and cpu_reset and makes
them pointers.

# I worry that these are set too late in the boot, especially cpu_reset.
2012-06-15 08:37:50 +00:00
Warner Losh
d56a9edddb These options are unused, and can safely be retired. 2012-06-15 08:01:16 +00:00
Warner Losh
dc5f8dab53 This hints file doesn't actually do anything, and besides it is commented
out here.  Remove it.
2012-06-15 07:56:53 +00:00
Warner Losh
e6e7584dcd Collapse the files.at91 and files.at91sam9 back into files.at91.
Create a new option for at91rm9200 support.  Set this option in
std.at91.  Create a new option for the at91sam9 standard devices.  Set
this option in std.at91sam9.  Retire files.at91sam9.  Add options for
at91sam9x25 SoC and SAM9X25EK board, but don't connect it just yet as
the supporting files aren't quite ready.

Note: device at91rm9200 and device at91sam9 are presently mutually
exclusive.
2012-06-15 07:50:26 +00:00
Warner Losh
aa0c93a5ca Fix a global shadowing problem when LINUX_BOOT_ABI was defined. 2012-06-15 07:26:39 +00:00