summaryrefslogtreecommitdiffstats
path: root/drivers/sh
Commit message (Collapse)AuthorAgeFilesLines
* sh: intc: Initialize radix tree gfp mask explicitly.Paul Mundt2010-12-241-0/+1
| | | | | | | | | | | Presently the root node is initialized by way of kzalloc on the parent data structure, which by chance happens to do the bulk of what an explicit initialization does with GFP_NOWAIT semantics. This however is more by luck than by design, and as we ideally want to permit radix node allocations access to the emergency pools anyways, add in the proper initializer with the desired mask. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branch 'common/clkfwk' into sh-fixes-for-linusPaul Mundt2010-11-192-1/+4
|\
| * sh: clkfwk: Build fix for non-legacy CPG changes.Paul Mundt2010-11-192-1/+4
| | | | | | | | | | | | | | | | | | The disabling of the init op for non-legacy clocks neglected to do the same in the core clock framework, resulting in a build failure. Fix it up. Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | Merge branch 'common/clkfwk' into sh-fixes-for-linusPaul Mundt2010-11-162-13/+5
|\|
| * sh: clkfwk: Kill off now unused algo_id in set_rate op.Paul Mundt2010-11-152-6/+4
| | | | | | | | | | | | | | | | Now that clk_set_rate_ex() is gone, there is also no way to get at rate setting algo id, which is now also completely unused. Kill it off before new clock ops start using it. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: clkfwk: Kill off unused clk_set_rate_ex().Paul Mundt2010-11-151-9/+3
| | | | | | | | | | | | | | | | With the refactoring of the SH7722 clock framework some time ago this abstraction has become unecessary. Kill it off before anyone else gets the bright idea to start using it. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: intc: Fix up build failure introduced by radix tree changes.Paul Mundt2010-11-151-1/+1
|/ | | | | | | | | The radix tree retry logic got a bit of an overhaul and subsequently broke the virtual IRQ subgroup build. Simply switch over to radix_tree_deref_retry() as per the filemap changes, which the virq lookup logic was modelled after in the first place. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: clkfwk: fix up compiler warnings.Paul Mundt2010-11-101-2/+2
| | | | | | | | | CC drivers/sh/clk/core.o drivers/sh/clk/core.c: In function 'clk_round_parent': drivers/sh/clk/core.c:574: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int' drivers/sh/clk/core.c:594: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int' Signed-off-by: Paul Mundt <lethal@linux-sh.org>
*-. Merge branches 'sh/pio-death', 'sh/nommu', 'sh/clkfwk', 'sh/core' and ↵Paul Mundt2010-11-083-4/+96
|\ \ | | | | | | | | | 'sh/intc-extension' into sh-fixes-for-linus
| | * sh: intc: Update for single IRQ reservation helper.Paul Mundt2010-11-012-2/+2
| |/ |/| | | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: clkfwk: Fix up checkpatch warnings.Paul Mundt2010-11-081-5/+22
| | | | | | | | | | | | | | The clk_round_parent() change introduced various checkpatch warnings, tidy them up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: add clk_round_parent() to optimize parent clock rateGuennadi Liakhovetski2010-11-081-0/+75
| | | | | | | | | | | | | | | | | | | | | | Sometimes it is possible and reasonable to adjust the parent clock rate to improve precision of the child clock, e.g., if the child clock has no siblings. clk_round_parent() is a new addition to the SH clock-framework API, that implements such an optimization for child clocks with divisors, taking all integer values in a range. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: clkfwk: Fix up rate rounding error handling.Paul Mundt2010-11-011-2/+2
|/ | | | | | | | | | According to the linux/clk.h definition we should be handing back an errno value or a valid rate. This fixes up the case where 0 can be returned for invalid frequencies or cases where rounding has no selectable candidate. Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: intc: switch irq_desc iteration to new active IRQ iterator.Paul Mundt2010-10-281-8/+2
| | | | | | | | There's no need to iterative over every single irq_desc when we can already work out which IRQs have a backing descriptor via the shiny new for_each_active_irq(). Switch to that instead. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: intc: irq_data conversion.Paul Mundt2010-10-274-40/+68
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: maple: ctrl_in/outX to __raw_read/writeX conversion.Paul Mundt2010-10-271-10/+10
| | | | | | | The ctrl_xxx routines are deprecated, switch over to the __raw_xxx versions. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Switch dynamic IRQ creation to generic irq allocator.Paul Mundt2010-10-262-75/+9
| | | | | | | | | | | Now that the genirq code provides an IRQ bitmap of its own and the necessary API to manipulate it, there's no need to keep our own version around anymore. In the process we kill off some unused IRQ reservation code, with future users now having to tie in to the genirq API as normal. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Sanitize sparse irqThomas Gleixner2010-10-262-19/+14
| | | | | | | Switch over to the new allocator functions. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: clkfwk: Shuffle around to match the intc split up.Paul Mundt2010-10-184-5/+16
| | | | | | | | This shuffles the clock framework code around to a drivers/sh/clk subdir, to follow the intc split up. This will make it easier to subsequently break things out as well as plug in different helpers for non-CPG users. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: clkfwk: modify for_each_frequency end conditionKuninori Morimoto2010-10-181-2/+5
| | | | | | | | | | | The end condition of for_each_frequency should care about both clk_rate_table_round and clk_rate_div_range_round, and using "correct max size" is a natural idea in later function. To avoid data over flow, this patch didn't modify clk_rate_div_range_round side as .max = div_max + 1. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: clkfwk: Fix fault in frequency iterator.Paul Mundt2010-10-161-1/+1
| | | | | | | When updating the iterator macro an old argument assignment was used on the initial assignment causing a fault on the table rounding. Fix it up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: clkfwk: Add a helper for rate rounding by divisor ranges.Paul Mundt2010-10-151-1/+21
| | | | | | | | | | | | | | | This adds a new clk_rate_div_range_round() for implementing rate rounding by divisor ranges. This can be used trivially by clocks that support arbitrary ranged divisors without the need for rate table construction. This should only be used by clocks that both have large divisor ranges in addition to clocks that will never be arbitrarily scaled, as the lack of a backing frequency table will prevent cpufreq from being able to do much of anything with them. Primarily intended for use as a ->recalc helper. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: clkfwk: Abstract rate rounding helper.Paul Mundt2010-10-151-14/+52
| | | | | | | | | | | | | Presently the only assisted rate rounding is frequency table backed, but there are cases where it's impractical to use a frequency table for certain clocks (such as the FSIDIV case, which supports 65535 divisors), and we wish to reuse the same rate rounding algorithm. This breaks out the core of the rate rounding logic in to its own helper routine and shuffles the frequency table logic around, switching to using an iterator for the generic helper routine. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: clkfwk: support clock remapping.Paul Mundt2010-10-151-2/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements support for ioremapping of register windows that encapsulate clock control registers used by a struct clk, with transparent sibling inheritance. Root clocks at the top of a given topology often encapsulate the entire register space of all of their sibling clocks, so this mapping can be done once and handed down. A given clock enable/disable case maps out to a single bit in a shared register, so this prevents creating multiple overlapping mappings. The mapping case breaks down in to a couple of different situations: - Sibling clocks without a specific mapping. - Root clocks without a specific mapping. - Any of sibling/root clocks with a specific mapping. Sibling clocks with no specified mapping will grovel up the clock chain and install the root clock mapping unconditionally at registration time. Root clocks without their own mappings have a dummy BSS-initialized mapping inserted that is handed down the chain just like any other mapping. This permits all of the sibling clock ops to read/write using the mapping offsets without any special configuration, enabling them to not care whether access ultimately goes through translatable or untranslatable memory. Any clock with its own mapping will have the window initialized at registration time and be ready for use by its clock ops. Failure to establish the mapping will prevent registration, so no additional sanity checks are needed. Sibling clocks that double as parents for the moment will not propagate their mapping down, but this is easily tunable if the need arises. All clock mappings are kref refcounted, with each instance of mapping inheritance incrementing the refcount. Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: use pr_fmt for clock framework, too.Paul Mundt2010-10-131-1/+3
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: remove name and id from struct clkMagnus Damm2010-10-132-10/+6
| | | | | | | | | | Remove "name" and "id" from drivers/sh/ struct clk. The struct clk members "name" and "id" are not used now when matching is done through clkdev. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: intc: Fix build with IRQ balancing disabled.Paul Mundt2010-10-061-4/+5
| | | | | | The balancing stubs obviously need to be static inline.. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: intc: Add missing files.Paul Mundt2010-10-062-0/+40
| | | | | | | The Kconfig and Makefile were overlooked, add those in now to improve odds of building. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: intc: Split up the INTC code.Paul Mundt2010-10-0513-1808/+2051
| | | | | | | | | | | | | This splits up the sh intc core in to something more vaguely resembling a subsystem. Most of the functionality was alread fairly well compartmentalized, and there were only a handful of interdependencies that needed to be resolved in the process. This also serves as future-proofing for the genirq and sparseirq rework, which will make some of the split out functionality wholly generic, allowing things to be killed off in place with minimal migration pain. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: intc: Handle early lookups of subgroup IRQs.Paul Mundt2010-10-051-10/+24
| | | | | | | | | If lookups happen while the radix node still points to a subgroup mapping, an IRQ hasn't yet been made available for the specified id, so error out accordingly. Once the slot is replaced with an IRQ mapping and the tag is discarded, lookup can commence as normal. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: intc: Support virtual mappings for IRQ subgroups.Paul Mundt2010-10-051-66/+338
| | | | | | | | | | | | | | | | | | | | Many interrupts that share a single mask source but are on different hardware vectors will have an associated register tied to an INTEVT that denotes the precise cause for the interrupt exception being triggered. This introduces the concept of IRQ subgroups in the intc core, where a virtual IRQ map is constructed for each of the pre-defined cause bits, and a higher level chained handler takes control of the parent INTEVT. This enables CPUs with heavily muxed IRQ vectors (especially across disjoint blocks) to break things out in to a series of managed chained handlers while being able to dynamically lookup and adopt the IRQs created for them. This is largely an opt-in interface, requiring CPUs to manually submit IRQs for subgroup splitting, in addition to providing identifiers in their enum maps that can be used for lazy lookup via the radix tree. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: intc: Implement reverse mapping for IRQs to per-controller IDs.Paul Mundt2010-10-052-1/+99
| | | | | | | | | | | | | This implements a scheme roughly analogous to the PowerPC virtual to hardware IRQ mapping, which we use for IRQ to per-controller ID mapping. This makes it possible for drivers to use the IDs directly for lookup instead of hardcoding the vector. The main motivation for this work is as a building block for dynamically allocating virtual IRQs for demuxing INTC events sharing a single INTEVT in addition to a common masking source. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Fix up BUG() triggered by gpiolib debugfs lookups.Paul Mundt2010-10-041-4/+2
| | | | | | | | | | | | The gpiolib debugfs entry takes a hammer approach and iterates over all of the potential GPIOs, regardless of their type. The SH PFC code on the other hand contains a variable mismash of input/output/function types spread out sparsely, leading to situations where the debug code can trigger an out of range enum for the type. Since we already have an error path for out of range enums, we can just hand that up to the higher level instead of the current BUG() behaviour. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: support pinmux deregistration.Paul Mundt2010-10-041-1/+10
| | | | | | | | | | Presently the pinmux code is a one-way thing, but there's nothing preventing an unregistration if no one has grabbed any of the pins. This will permit us to save a bit of memory on systems that require pin demux for certain peripherals in the case where registration of those peripherals fails, or they are otherwise not attached to the system. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Support early IRQ vector map reservation for delayed controllers.Paul Mundt2010-10-021-0/+11
| | | | | | | | | | Some controllers will need to be initialized lazily due to pinmux constraints, while others may simply have no need to be brought online if there are no backing devices for them attached. In this case it's still necessary to be able to reserve their hardware vector map before dynamic IRQs get a hold of them. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Support IRQ balancing for SH-X3 proto cores, too.Paul Mundt2010-10-021-1/+1
| | | | | | | This adds in hardware IRQ auto-distribution support for SH-X3 proto CPUs, following the SH7786 support. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: reinstate clock framework rate rounding.Paul Mundt2010-08-201-1/+15
| | | | | | | | | | | This was killed off by a simplification patch previously that failed to take the cpufreq use case in to account, so reinstate the old bounding logic. The lowest rate bounding on the other hand was broken in that it never actually got assigned a rate and the best fit rate was instead just getting lucky based on the ordering of the rate table, fix this up so the code actually does what it was intended to do originally. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branch 'master' of ↵Paul Mundt2010-08-162-4/+59
|\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: arch/sh/include/asm/Kbuild drivers/Makefile Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: add a reparent function to DIV6 clocksGuennadi Liakhovetski2010-08-041-2/+56
| | | | | | | | | | | | | | | | Add support for reparenting of div6 clocks on SuperH and SH-Mobile SoCs. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * Merge branch 'master' of ↵Paul Mundt2010-07-051-5/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: include/linux/serial_sci.h Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | ARM: mach-shmobile: Use shared clock frameworkMagnus Damm2010-05-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach SH-Mobile ARM how to make use of the shared SH clock framework. This commit is one atomic switch that dumps the local hackery and instead links in the shared clock framework code in drivers/sh. A few local functions are kept in clock.c. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: remove bogus highest / lowest logic from clock rate roundingGuennadi Liakhovetski2010-07-021-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | The use of highest and lowest in clk_rate_table_round() is completely bogus and superfluous. Remove it. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | | sh: move a debug printk() to a more meaningful location in the clock driverGuennadi Liakhovetski2010-07-021-2/+2
| |/ |/| | | | | | | | | | | To actually output the _new_ clock rate it first has to be set. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Make intc messages consistent via pr_fmt.Paul Mundt2010-06-021-5/+7
|/ | | | | | | | Wrapping pr_fmt to the KBUILD_MODNAME prefix seems to be the trendy thing to do these days, so just do that instead of manually tidying up the stragglers. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: simplify WARN usage in SH clock driverGuennadi Liakhovetski2010-05-131-5/+2
| | | | | Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: move sh clock-cpg.c contents to drivers/sh/clk-cpg.cMagnus Damm2010-05-132-0/+299
| | | | | | | | | | Move the CPG helpers to drivers/sh/clk-cpg.c V2. This to allow SH-Mobile ARM to share the code with SH. All functions except the legacy CPG stuff is moved. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: move sh clock.c contents to drivers/sh/clk.Magnus Damm2010-05-132-0/+549
| | | | | | | | | | | | | | | | | This patch is V2 of the SH clock framework move from arch/sh/kernel/cpu/clock.c to drivers/sh/clk.c. All code except the following functions are moved: clk_init(), clk_get() and clk_put(). The init function is still kept in clock.c since it depends on the SH-specific machvec implementation. The symbols clk_get() and clk_put() already exist in the common ARM clkdev code, those symbols are left in the SH tree to avoid duplicating them for SH-Mobile ARM. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branch 'sh/stable-updates'Paul Mundt2010-04-261-0/+1
|\ | | | | | | | | | | | | | | Conflicts: arch/sh/kernel/dwarf.c drivers/dma/shdma.c Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* | sh: intc: IRQ auto-distribution support.Paul Mundt2010-04-152-52/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements support for hardware-managed IRQ balancing as implemented by SH-X3 cores (presently only hooked up for SH7786, but can probably be carried over to other SH-X3 cores, too). CPUs need to specify their distribution register along with the mask definitions, as these follow the same format. Peripheral IRQs that don't opt out of balancing will be automatically distributed at the whim of the hardware block, while each CPU needs to verify whether it is handling the IRQ or not, especially before clearing the mask. Signed-off-by: Paul Mundt <lethal@linux-sh.org>