summaryrefslogtreecommitdiffstats
path: root/sys/arm/xscale/ixp425/avila_machdep.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r293045, r293046:ian2016-01-241-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the 'env' directive described in config(5) work on all architectures, providing compiled-in static environment data that is used instead of any data passed in from a boot loader. Previously 'env' worked only on i386 and arm xscale systems, because it required the MD startup code to examine the global envmode variable and decide whether to use static_env or an environment obtained from the boot loader, and set the global kern_envp accordingly. Most startup code wasn't doing so. Making things even more complex, some mips startup code uses an alternate scheme that involves calling init_static_kenv() to pass an empty buffer and its size, then uses a series of kern_setenv() calls to populate that buffer. Now all MD startup code calls init_static_kenv(), and that routine provides a single point where envmode is checked and the decision is made whether to use the compiled-in static_kenv or the values provided by the MD code. The routine also continues to serve its original purpose for mips; if a non-zero buffer size is passed the routine installs the empty buffer ready to accept kern_setenv() values. Now if the size is zero, the provided buffer full of existing env data is installed. A NULL pointer can be passed if the boot loader provides no env data; this allows the static env to be installed if envmode is set to do so. Most of the work here is a near-mechanical change to call the init function instead of directly setting kern_envp. A notable exception is in xen/pv.c; that code was originally installing a buffer full of preformatted env data along with its non-zero size (like mips code does), which would have allowed kern_setenv() calls to wipe out the preformatted data. Now it passes a zero for the size so that the buffer of data it installs is treated as non-writeable. Also, revert accidental change that snuck into r293045.
* MFC 265852: Map device memory using PTE_DEVICE rather than PTE_NOCACHE.ian2014-05-181-18/+18
|
* MFC 262952, 262958, 262966, 262979, 262980, 262986, 262987, 262995, 262997,ian2014-05-171-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 263030, 263033, 263034, 263056, 263057, Remove all the redundant external declarations of exception vectors and runtime setting of the pointers that's scattered around various places. Remove all traces of support for ARM chips prior to the arm9 series. Make the default exception handler vectors point to where I thought they were already pointing: the default handlers (not a panic that says there is no default handler). Eliminate irq_dispatch.S. Move the data items it contained into arm/intr.c and the functionality it provided into arm/exception.S. Move the exception vector table (so-called "page0" data) into exception.S and eliminate vectors.S. Change the way the asm GET_CURTHREAD_PTR() macro is defined so that code using it doesn't have to have an "AST_LOCALS" macro somewhere in the file. Arrange for arm fork_trampoline() to return to userland via the standard swi_exit code in exception.S instead of having its own inline expansion of the DO_AST and PULLFRAME macros. Now that the PUSHFRAME and PULLFRAME macros are used only in the swi entry/exit code, they don't need to be macros. Except that didn't work and the whole change was reverted. Remove some unnecessary indirection and jump right to the handler functions. Use panic rather than printf to "handle" an arm26 address exception (should never happen on arm32). Remove the unreferenced DATA() macro. Remove #include <machine/asmacros.h> from files that don't need it.
* MFC r261643, r261646, r261648, r261649, r261651, r261656, r261657, r261663,ian2014-05-151-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r261676, r261677, r261698, r261778 Consolidate code related to setting up physical memory configuration into a new physmem.c file. Replace compile-time constant KERNPHYSADDR with abp_physaddr Calculate the kernel's load address from the PC in the elf / gzip trampoline instead of relying on KERNPHYSADDR as a compile-time constant. It turns out a global variable is the only straightforward way to communicate the kernel's physical load address from where it's known in initarm() into cpu_mp_start() which is called from non-arm code and takes no parameters. Remove the now unused MMU_INIT macro. Use vm_paddr_t, not vm_offset_t, when dealing with physical addresses. No need to set physmem in each initarm() instance anymore, it's handled in common code now. Pass the pagetable used from locore.S to initarm to allow it to map data in as required. Fix the physmem exclude-region clipping logic for the edge-trim case. Add some extra debugging output when DEBUG is defined. Update legacy platforms to use new arm_physmem helper routines.
* MFC r257549, r261642ian2014-05-151-33/+0
| | | | | | | | | Don't create a distinct free page pool for segregating allocations that are accessed through the direct map unless the kernel configuration actually includes a direct map. Only a few configurations do, and for the rest the unnecessary free page pool is a small pessimization. Remove the ARM_USE_SMALL_ALLOC option and code related to it.
* MFC r261423, r261424, r261516, r261513, r261562, r261563, r261564, r261565,ian2014-05-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | r261596, r261606 Add the imx sdhci controller. Move Open Firmware device root on PowerPC, ARM, and MIPS systems to a sub-node of nexus (ofwbus) rather than direct attach under nexus. This fixes FDT on x86 and will make coexistence with ACPI on ARM systems easier. SPARC is unchanged. Add the missing ')' at end of sentence. Reword it to use a more common idiom. Pass the kernel physical address to initarm through the boot param struct. Make functions only used in vfp.c static, and remove vfp_enable. Fix __syscall on armeb EABI. As it returns a 64-bit value it needs to place 32-bit data in r1, not r0. 64-bit data is already packed correctly. Use abp_physaddr for the physical address over KERNPHYSADDR. This helps us remove the need to load the kernel at a fixed address. Remove references to PHYSADDR where it's used only in debugging output. Dynamically generate the page table. This will allow us to detect the physical address we are loaded at to change the mapping.
* MFC r262020:jhay2014-03-111-0/+2
| | | | | | | | | | | | | Make it possible to use the env kernel config file option for AVILA and CAMBRIA boards that does not use loader to load the kernel. This is basically how it was done for i386. This way tunables can also be set. For example in config file: env "/conf/AVILA.env" And in AVILA.env: vfs.unmapped_buf_allowed=0
* MFC r258392, r258412:ian2013-12-141-0/+2
| | | | | | | | | | | | Call cpu_setup() immediately after the page tables are installed. This enables data cache and other chip-specific features. It was previously done via an early SYSINIT, but it was being done after pmap and vm setup, and those setups need to use mutexes. On some modern ARM platforms, the ldrex/strex instructions that implement mutexes require the data cache to be enabled. Call cpu_setup() from the initarm() routine on platforms that don't use the common FDT-aware initarm() in arm/machdep.c.
* MFC r257648, r257649, r257660:ian2013-12-131-4/+5
| | | | | | | | | | | | | | | | | Begin reducing code duplication in arm pmap.c and pmap-v6.c by factoring out common code related to mapping device memory into a new devmap.c file. Remove the growing duplication of code that used pmap_devmap_find_pa() and then did some math with the returned results to generate a virtual address, and likewise in reverse to get a physical address. Now there are a pair of functions, arm_devmap_vtop() and arm_devmap_ptov(), to do that. The bus_space_map() implementations are rewritten in terms of these. Move remaining code and data related to static device mapping into the new devmap.[ch] files. Emphasize the MD nature of these things by using the prefix arm_devmap_ on the function and type names (already a few of these things found their way into MI code, hopefully it will be harder to do by accident in the future).
* Eliminate a redundant #include: machine/pmap.h is already includedalc2013-03-011-1/+0
| | | | through vm/pmap.h.
* Complete r247297:attilio2013-02-281-2/+0
| | | | | | Remove unused inclusions of vm/vm_pager.h and vm/vnode_pager.h. Sponsored by: EMC / Isilon storage division
* Initialize vm_max_kernel_address on non-FDT platforms. (This should havealc2013-02-201-1/+2
| | | | | | | | been included in r246926.) The second parameter to pmap_bootstrap() is redundant. Eliminate it. Reviewed by: andrew
* Create a common set_stackptrs in sys/arm/machdep.c.andrew2012-09-221-8/+1
| | | | | | | On single core devices set_stackptrs is only ever called with cpu = 0 in initarm and will be identical to the existing function. On SMP this needs to be implemented for sys/arm/mp_machdep.c, but the implementations are identical for each SoC.
* Merging projects/armv6, part 1gonzo2012-08-151-3/+0
| | | | | | | | | Cummulative patch of changes that are not vendor-specific: - ARMv6 and ARMv7 architecture support - ARM SMP support - VFP/Neon support - ARM Generic Interrupt Controller driver - Simplification of startup code for all platforms
* Remove some unused variables/externs that have been copied too many times...imp2012-07-101-5/+0
|
* More Linux boot support. Create arm_dump_avail_init() to initializeimp2012-06-141-5/+1
| | | | | | this array either from Linux boot data, when enabled, or in the typical way that most ports do it. arm_pyhs_avail_init is coming soon since it must be a separate function.
* Modify all the arm platform files to call parse_boot_param passing inimp2012-06-141-1/+1
| | | | | | | | | | | | | the boot parameters from initarm first thing. parse_boot_param parses the boot arguments and converts them to the /boot/loader metadata the rest of the kernel uses. parse_boot_param is a weak alias to fake_preload_metadata, which all the platforms use now, but may become more extensive in the future. Since it is a weak symbol, specific boards may define their own parse_boot_param to interface to custom boot loaders. Reviewed by: cognet@, Ian Lapore
* Remove leakage of other patches into last commit.imp2012-06-131-1/+1
|
* trim trailing spaces that have accumulated over the years (these filesimp2012-06-131-5/+5
| | | | served as the basis for too many other platforms).
* Pull out the common code to initialise proc0 & thread0 from initarm to aandrew2012-06-101-9/+1
| | | | | | common function. Reviewed by: imp
* Minor rearrangement of the locore <-> initarm interface. Pass in aimp2012-06-031-1/+1
| | | | | | structure with the first 4 registers to allow a wider range of boot loaders to work. Future commits will make use of this to centralize support for the different loaders.
* Call init_param1() much earlier, so that msgbufsize is non-zero when we wantcognet2011-02-131-2/+3
| | | | to map and use the msgbuf.
* Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize.pluknet2011-01-211-4/+2
| | | | | | | Submitted by: perryh pluto.rain.com (previous version) Reviewed by: jhb Approved by: kib (mentor) Tested by: universe
* Implement a facility for dynamic per-cpu variables.jeff2009-06-231-0/+5
| | | | | | | | | | | | | | | - Modules and kernel code alike may use DPCPU_DEFINE(), DPCPU_GET(), DPCPU_SET(), etc. akin to the statically defined PCPU_*. Requires only one extra instruction more than PCPU_* and is virtually the same as __thread for builtin and much faster for shared objects. DPCPU variables can be initialized when defined. - Modules are supported by relocating the module's per-cpu linker set over space reserved in the kernel. Modules may fail to load if there is insufficient space available. - Track space available for modules with a one-off extent allocator. Free may block for memory to allocate space for an extent. Reviewed by: jhb, rwatson, kan, sam, grehan, marius, marcel, stas
* map the optional GPS and RS485 uart's on the Gateworks Cambria boardsam2009-06-221-7/+14
| | | | (may want to make these conditional)
* map CS0 on 2358 so flash is accessiblesam2009-03-101-0/+4
|
* remove unneeded static mappings for NPE and MAC regions; these aresam2009-03-061-34/+0
| | | | | | already mapped through the IO region so never used Reviewed by: imp, thompsa
* fix ARM_USE_SMALL_ALLOC after memory layout changessam2009-02-111-7/+10
| | | | Submitted by: cognet
* Add support for the StrataFlash on 2348 boards:sam2009-02-031-0/+4
| | | | | | | | | o add bus shim for cfi driver o add static mapping for CS0 (we map all 16M as the cfi driver doesn't support demand mapping) Note this needs some tweaking to work for 2358 boards which is why the CAMBRIA config is not touched.
* Merge WIP from p4:sam2008-12-131-157/+170
| | | | | | | | | | | | | | | | | | o recognize ixp435 cpu o change memory layout for for ixp4xx to not assume memory is aliases to 0x10000000 (Cambria/ixp435 memory starts at zero) o handle 64 irqs for ixp435 o dual EHCI USB 2.0 controller integral to ixp435 o overhaul NPE code for ixp435 and better MAC+MII naming o updated NPE firmware (including NPE-A image for ixp435/ixp465) o Gateworks Cambria board support: - IDE compact flash - MCU - front panel LED on i2c bus - Octal LED latch Sanity-tested with NFS-root on Avila and Cambria boards. Requires pending boot2 mods for CF-boot on Cambria.
* - Fix spelling error in comments.stas2008-12-011-1/+1
| | | | | | PR: arm/128891 Submitted by: Pavel Pankov <pankov_p@mail.ru> Approved by: kib (mentor)
* Allow static hints to override kenv.bms2008-10-021-0/+5
|
* Eliminate unused global variables. (These global variables became fields ofalc2008-07-181-1/+0
| | | | struct kva_md_info many years ago.)
* Remove some long-dead codekevlo2008-04-081-4/+0
| | | | Reviewed by: cognet
* Fix AVILA build.raj2008-04-031-2/+2
| | | | | Reviewed by: sam Approved by: cognet(mentor)
* Take the first baby step towards unifying and cleaning up arminit():imp2008-04-031-48/+1
| | | | | | | | - Pull all the code to deal with the trampoline stuff into one centeralized place and use it from everywhere. - Some minor style tidiness Reviewed by: tinguely
* KERNBASE + 0x00200000 is the same thing as KERNVIRTADDR on thisimp2008-04-031-3/+2
| | | | | | platform, so use the latter in preference to the former. This makes the fake_preload setup be the same between kb920x_machdep.c and avila_machdep.c....
* Fix for the panic("vm_thread_new: kstack allocation failed") andkib2007-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | silent NULL pointer dereference in the i386 and sparc64 pmap_pinit() when the kmem_alloc_nofault() failed to allocate address space. Both functions now return error instead of panicing or dereferencing NULL. As consequence, vmspace_exec() and vmspace_unshare() returns the errno int. struct vmspace arg was added to vm_forkproc() to avoid dealing with failed allocation when most of the fork1() job is already done. The kernel stack for the thread is now set up in the thread_alloc(), that itself may return NULL. Also, allocation of the first process thread is performed in the fork1() to properly deal with stack allocation failure. proc_linkup() is separated into proc_linkup() called from fork1(), and proc_linkup0(), that is used to set up the kernel process (was known as swapper). In collaboration with: Peter Holm Reviewed by: jhb
* Remove duplicate includes.cognet2007-05-231-1/+0
| | | | Submitted by: Cyril Nguyen Huu <cyril ci0 org>
* Remove sa1_cache_clean_addr. It isn't needed.kevlo2007-05-031-2/+0
|
* Remove a bogus i = 0kevlo2007-02-021-1/+1
| | | | Approved by: cognet
* Threading cleanup.. part 2 of several.julian2006-12-061-4/+0
| | | | | | | | | | | | | | | | | | | | | | Make part of John Birrell's KSE patch permanent.. Specifically, remove: Any reference of the ksegrp structure. This feature was never fully utilised and made things overly complicated. All code in the scheduler that tried to make threaded programs fair to unthreaded programs. Libpthread processes will already do this to some extent and libthr processes already disable it. Also: Since this makes such a big change to the scheduler(s), take the opportunity to rename some structures and elements that had to be moved anyhow. This makes the code a lot more readable. The ULE scheduler compiles again but I have no idea if it works. The 4bsd scheduler still reqires a little cleaning and some functions that now do ALMOST nothing will go away, but I thought I'd do that as a separate commit. Tested by David Xu, and Dan Eischen using libthr and libpthread.
* Gateworks Avila board support:sam2006-11-191-0/+545
o ixp425 support o NPE network driver (requires Intel microcode) o h/w qmgr support o True IDE compact flash over expansion bus o pci (ath and hifn795x parts tested) o xscale watchdog timer o ds1672 RTC on i2c bus o ad7418 voltage + temp monitoring on i2c bus o uart Work done together with cognet, kevlo, and jmg. Parts of the ixp425 support obtaine/derived from netbsd. Reviewed by: cognet, imp MFC after: 1 month
OpenPOWER on IntegriCloud