Commit Graph

99 Commits (ab62aa931ed3512bc67857a03636756b96c78eae)

Author SHA1 Message Date
Paul Mundt e2fcf74f3d sh: nommu: use 32-bit phys mode.
The nommu code has regressed somewhat in that 29BIT gets set for the
SH-2/2A configs regardless of the fact that they are really 32BIT sans
MMU or PMB. This does a bit of tidying to get nommu properly selecting
32BIT as it was before.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-04 12:32:24 +09:00
Paul Mundt c993487ec8 sh: Provide a generic SRAM pool for tiny memories.
This sets up a generic SRAM pool for CPUs and platform code to insert
their otherwise unused memories into. A simple alloc/free interface is
provided (lifed from avr32) for generic code.

This only applies to tiny SRAMs that are otherwise unmanaged, and does
not take in to account the more complex SRAMs sitting behind transfer
engines, or that employ an I/D split.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-15 02:09:00 +09:00
Paul Mundt d01447b319 sh: Merge legacy and dynamic PMB modes.
This implements a bit of rework for the PMB code, which permits us to
kill off the legacy PMB mode completely. Rather than trusting the boot
loader to do the right thing, we do a quick verification of the PMB
contents to determine whether to have the kernel setup the initial
mappings or whether it needs to mangle them later on instead.

If we're booting from legacy mappings, the kernel will now take control
of them and make them match the kernel's initial mapping configuration.
This is accomplished by breaking the initialization phase out in to
multiple steps: synchronization, merging, and resizing. With the recent
rework, the synchronization code establishes page links for compound
mappings already, so we build on top of this for promoting mappings and
reclaiming unused slots.

At the same time, the changes introduced for the uncached helpers also
permit us to dynamically resize the uncached mapping without any
particular headaches. The smallest page size is more than sufficient for
mapping all of kernel text, and as we're careful not to jump to any far
off locations in the setup code the mapping can safely be resized
regardless of whether we are executing from it or not.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-18 18:13:51 +09:00
Paul Mundt b0f3ae03ac sh: Isolate uncached mapping support.
This splits out the uncached mapping support under its own config option,
presently only used by 29-bit mode and 32-bit + PMB. This will make it
possible to optionally add an uncached mapping on sh64 as well as booting
without an uncached mapping for 32-bit.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-02-12 15:40:00 +09:00
Matt Fleming 4d35b93a66 sh: Add fixed ioremap support
Some devices need to be ioremap'd and accessed very early in the boot
process. It is not possible to use the standard ioremap() function in
this case because that requires kmalloc()'ing some virtual address space
and kmalloc() may not be available so early in boot.

This patch provides fixmap mappings that allow physical address ranges
to be remapped into the kernel address space during the early boot
stages.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-16 14:31:36 +00:00
Paul Mundt 782bb5a532 sh: default to extended TLB support.
All SH-X2 and SH-X3 parts support an extended TLB mode, which has been
left as experimental since support was originally merged. Now that it's
had some time to stabilize and get some exposure to various platforms,
we can drop it as an option and default enable it across the board.

This is also good future proofing for newer parts that will drop support
for the legacy TLB mode completely.

This will also force 3-level page tables for all newer parts, which is
necessary both for the varying page sizes and larger memories.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 19:11:14 +09:00
Paul Mundt a0ab36689a sh: fixed PMB mode refactoring.
This introduces some much overdue chainsawing of the fixed PMB support.
fixed PMB was introduced initially to work around the fact that dynamic
PMB mode was relatively broken, though they were never intended to
converge. The main areas where there are differences are whether the
system is booted in 29-bit mode or 32-bit mode, and whether legacy
mappings are to be preserved. Any system booting in true 32-bit mode will
not care about legacy mappings, so these are roughly decoupled.

Regardless of the entry point, PMB and 32BIT are directly related as far
as the kernel is concerned, so we also switch back to having one select
the other.

With legacy mappings iterated through and applied in the initialization
path it's now possible to finally merge the two implementations and
permit dynamic remapping overtop of remaining entries regardless of
whether boot mappings are crafted by hand or inherited from the boot
loader.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-13 18:31:48 +09:00
Paul Mundt a7595fe7e8 Merge branch 'sh/pgtable' of git://github.com/mfleming/linux-2.6 2010-01-05 12:27:46 +09:00
Paul Mundt 921a220857 Merge branch 'sh/stable-updates' 2010-01-04 16:45:56 +09:00
Paul Mundt 5e9daa0f26 sh: Don't default enable PMB support.
This has the adverse effect of converting many 29bit configs to 32bit
mode, while this is a change that needs to be done manually for each
platform. Turn it off by default in order to cut down on spurious bug
reports.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-04 11:16:33 +09:00
Paul Mundt b4e2a2a2f3 sh: Disable PMB for SH4AL-DSP CPUs.
While the PMB is available on SH-4A parts, SH4AL-DSP parts exclude it
altogether. As such, explicitly disable PMB support for these parts. If
this changes in the future for newer subtypes, this will have to be made
more fine-grained.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-04 11:13:54 +09:00
Matt Fleming 3f5ab76816 sh: Correct the PTRS_PER_PMD and PMD_SHIFT values
The previous expressions were wrong which made free_pmd_range() explode
when using anything other than 4KB pages (which is why 8KB and 64KB
pages were disabled with the 3-level page table layout).

The problem was that pmd_offset() was returning an index of non-zero
when it should have been returning 0. This non-zero offset was used to
calculate the address of the pmd table to free in free_pmd_range(),
which ended up trying to free an object that was not aligned on a page
boundary.

Now 3-level page tables should work with 4KB, 8KB and 64KB pages.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2010-01-02 00:51:45 +00:00
Matt Fleming 5d9b4b19f1 sh: Definitions for 3-level page table layout
If using 64-bit PTEs and 4K pages then each page table has 512 entries
(as opposed to 1024 entries with 32-bit PTEs). Unlike MIPS, SH follows
the convention that all structures in the page table (pgd_t, pmd_t,
pgprot_t, etc) must be the same size. Therefore, 64-bit PTEs require
64-bit PGD entries, etc. Using 2-levels of page tables and 64-bit PTEs
it is only possible to map 1GB of virtual address space.

In order to map all 4GB of virtual address space we need to adopt a
3-level page table layout. This actually works out better for
CONFIG_SUPERH32 because we only waste 2 PGD entries on the P1 and P2
areas (which are untranslated) instead of 256.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-17 14:31:20 +09:00
Paul Mundt a4d9d0b8a8 sh: Enable PMB support for all SH-4A CPUs.
Presently the PMB options were limited to a number of CPUs they were
tested with, but it is generally available on all SH-4A CPUs, so just
drop the subtype conditionals.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-11-11 10:56:13 +09:00
Paul Mundt 9b3b21f788 Merge branch 'sh/stable-updates' 2009-10-27 17:10:24 +09:00
Paul Mundt ffb4a73d89 sh: Fix hugetlbfs dependencies for SH-3 && MMU configurations.
The hugetlb dependencies presently depend on SUPERH && MMU while the
hugetlb page size definitions depend on CPU_SH4 or CPU_SH5. This
unfortunately allows SH-3 + MMU configurations to enable hugetlbfs
without a corresponding HPAGE_SHIFT definition, resulting in the build
blowing up.

As SH-3 doesn't support variable page sizes, we tighten up the
dependenies a bit to prevent hugetlbfs from being enabled. These days
we also have a shiny new SYS_SUPPORTS_HUGETLBFS, so switch to using
that rather than adding to the list of corner cases in fs/Kconfig.

Reported-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-10-27 07:22:37 +09:00
Paul Mundt 896f0c0e8e sh: Support SCHED_MC for SH-X3 multi-cores.
This enables SCHED_MC support for SH-X3 multi-cores. Presently this is
just a simple wrapper around the possible map, but this allows for
tying in support for some of the more exotic NUMA clusters where we can
actually do something with the topology.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-10-16 18:00:02 +09:00
Matt Fleming b336f124b1 sh: CONFIG_PMB doesn't mean the MMU is in 32bit mode
CONFIG_PMB will eventually allow the MMU to be switched between 29-bit
and 32-bit mode dynamically at runtime.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-10-10 21:51:23 +09:00
Yoshihiro Shimoda c01f0f1a4a sh: Add initial support for SH7757 CPU subtype
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-21 17:25:47 +09:00
Paul Mundt ad3256e361 sh: Provide FORCE_MAX_ZONEORDER.
Several platforms want to be able to do large physically contiguous
allocations (primarily nommu and video codecs on SH-Mobile), provide a
MAX_ORDER override for those cases.

Tested-by: Conrad Parker <conrad@metadecks.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-14 17:40:08 +09:00
Paul Mundt b412a49af9 sh: Consolidate the boot link and entry offset definitions.
Consolidate these in a single place in the Kconfig menus. At the same
time, disable their interactivity and set them according to the board
config defaults.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-05-10 01:23:25 +09:00
Paul Mundt e8208828dc sh: Kill off broken direct-mapped cache mode.
Forcing direct-mapped worked on certain older 2-way set associative
parts, but was always error prone on 4-way parts. As these are the
norm these days, there is not much point in continuing to support this
mode. Most of the folks that used direct-mapped mode generally just
wanted writethrough caching in the first place..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-02 17:40:16 +09:00
Yoshihiro Shimoda 2f47f44790 sh: Support fixed 32-bit PMB mappings from bootloader.
This provides a method for supporting fixed PMB mappings inherited from
the bootloader, as an alternative to the dynamic PMB mapping currently
used by the kernel. In the future these methods will be combined.

P1/P2 area is handled like a regular 29-bit physical address, and local
bus device are assigned P3 area addresses.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10 15:49:54 +09:00
Paul Mundt b85641bdde sh: Make memory hot-add and hot-remove depend on MMU.
Cleans up link numerous build issues with page migration and so on when
enabled on nommu builds.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-17 23:13:27 +09:00
Paul Mundt 3159e7d62a sh: Add support for memory hot-remove.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08 10:35:04 +09:00
Paul Mundt 68b7c24cf9 sh: Disable 64kB hugetlbpage size when using 64kB PAGE_SIZE.
Presently we oops in mm/hugetlb.c:1325, which is the order == 0 test in
hugetlb_add_hstate() called at initialization time. So, disable 64kB
huge pages when we're using a 64kB PAGE_SIZE. On most parts this will
force the default to be 1MB huge pages.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-11 20:17:49 +09:00
Yoshinori Sato cce2d453e4 SH2(A) cache update
Includes:
- SH2 (7619) Writeback support.
- SH2A cache handling fix.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-08-04 16:33:47 +09:00
Yoshihiro Shimoda 82cb1f6fb3 sh: fix uImage Entry Point
fix the problem that cannot boot using uImage when PAGE_SIZE is
8kbyte or 64kbyte.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:16:41 +09:00
Paul Mundt 66dfe18114 sh: Add support for 16kB PAGE_SIZE.
16kB is a useful size on nommu, while 64kB still tends to be too big to
be useful. Newer MMUs are likely to support this as well, so plug it
in in anticipation of those, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:29 +09:00
Paul Mundt 74fcc77982 sh: Support variable page sizes on nommu.
PAGE_SIZE doesn't need to be fixed at 4096 on nommu, so stub in a !MMU
case for the various PAGE_SIZE Kconfig options.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28 18:10:28 +09:00
Paul Mundt 2af8b3b642 sh: Flag PMB support as EXPERIMENTAL.
There's still work that needs to be done here, and this should not be
enabled by default on existing boards.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-03-06 16:06:38 +09:00
Paul Mundt 711fe4369c sh: Bump the MEMORY_SIZE default to something reasonable.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:52 +09:00
Paul Mundt 36763b22be sh: Switch SH-5 to use CONFIG_PAGE_OFFSET.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:51 +09:00
Paul Mundt 079060c6ff sh: Fix up 64kB page size selection on SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:45 +09:00
Paul Mundt 36bcd39dbc sh: Split out 29-bit and 32-bit physical mode definitions.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:42 +09:00
Paul Mundt a09063da33 sh: Switch Kconfig.sh64 to use arch/sh/mm/Kconfig.
Consolidates the HUGETLB definitions and others.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:39 +09:00
Paul Mundt b5f42db0a7 sh: Move CPU subtypes to Kconfig.sh.
We intend to share the mm options, so move the SH-only subtypes
up a level.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:38 +09:00
Paul Mundt f966918724 sh: Kill off the remaining ST40 cruft.
The ST40 stuff in-tree hasn't built for some time, and hasn't been
updated for over 3 years. ST maintains their own out-of-tree changes
and rebases occasionally, and that's ultimately where all of the ST40
users go anyways.

In order for the ST40 code to be brought up to date most of the stuff
removed in this changeset would have to be rewritten anyways, so there's
very little benefit in keeping the remnants around either.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07 11:13:55 +09:00
Paul Mundt c3af39758c sh: Support extended mode TLB on SH-X3.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-27 18:08:46 +09:00
Paul Mundt dc47e9dd41 sh: Bump MAX_ACTIVE_REGIONS for SH7785.
When using URAM in NUMA mode another active region is needed.
Bump this up so we don't trigger the region truncation in
add_active_range().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-27 16:48:00 +09:00
Paul Mundt 4d2cab7c00 sh: Disable 4kB pages on extended mode TLB.
4kB pages are unstable on extended mode TLB, it's recommended
that TLB compat mode be used when using a 4kB PAGE_SIZE. Set
the default for extended mode to 8kB.

This should have negligible impact, as other than the extra swap
cache entry bits, there's no reason to use the extended mode TLB
with 4kB pages.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-27 10:47:00 +09:00
Paul Mundt 1a442fe02d sh: Initial SH-X3 SMP support.
This adds basic support for SH-X3 SMP (4 CPUs).

More IPI and cache debugging is necessary, mostly interfacing the
d-cache coherency and the I-cache broadcast invalidates. Only for
testing at present!

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 19:16:05 +09:00
Paul Mundt db2504966c sh: Wire up URAM node on SH7785.
Add SH7785 URAM as node 1, follows the SH-X3 change.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:55 +09:00
Paul Mundt 1db4e9bb56 sh: Don't enable FPU for SH4AL-DSP.
This leads to invalid configurations where both FPU and DSP support
can be enabled in the same kernel, resulting in build failure.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:53 +09:00
Magnus Damm 5cbc3af521 sh: minor fixes
This patch contains the following fixes:
- Adds sh7785 support to CONFIG_EARLY_SCIF_CONSOLE_PORT.
- Removes duplicate include from rts7751r2d irq code.
- Removes CONFIG_CPU_HAS_INTC from sh7720 Kconfig entry.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:52 +09:00
Magnus Damm 1254d1db11 sh: remove CONFIG_CPU_HAS_INTC_IRQ
All processor specific interrupt code is now converted to make use
of the new intc code. The config option CONFIG_CPU_HAS_INTC_IRQ is
because of that pointless.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:51 +09:00
Magnus Damm 2eb0303c2c sh: intc - add support for sh7206
This patch converts the cpu specific interrupt setup code for sh7206
from ipr to intc. New vectors are also added to match the information
provided by the datasheet.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:50 +09:00
Magnus Damm 0dc3fc04dd sh: intc - add support for sh7619
This patch converts the cpu specific interrupt setup code for sh7619
from ipr to intc. New vectors are also added to match the information
provided by the datasheet.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:50 +09:00
Markus Brunner 3ea6bc3de4 sh: Add SH7720 CPU support.
This adds support for the SH7720 (SH3-DSP) CPU.

Signed-off by: Markus Brunner <super.firetwister@gmail.com>
Signed-off by: Mark Jonas <toertel@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:49 +09:00
Paul Mundt 9904494d6a sh: Bump up NODES_SHIFT for SH-X3.
This was at 1, which is where most subtypes want it. SH-X3 has
more nodes, so bump it up to 3.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-09-21 11:57:48 +09:00