linux/arch/arm/plat-omap
Russell King a1af0fbbba ARM: OMAP: Cleanup OMAP FB SDRAM reservation
The logic in this file is rather convoluted, but essentially:

1. region type 0 is SDRAM
2. referring to the code fragment
                if (set_fbmem_region_type(&rg, OMAPFB_MEMTYPE_SDRAM,
                                          sdram_start, sdram_size) < 0 ||
                    (rg.type != OMAPFB_MEMTYPE_SDRAM))
                        continue;
   - if rg.type is not OMAPFB_MEMTYPE_SDRAM, set_fbmem_region_type()
     returns zero immediately (since rg.type is non-zero), and so we
     'continue'.
   - if rg.type is OMAPFB_MEMTYPE_SDRAM, and rg.paddr is zero,
     we fall through.
   - if rg.type is OMAPFB_MEMTYPE_SDRAM, and the region lies within
     SDRAM, we fall through.
   - if rg.type is OMAPFB_MEMTYPE_SDRAM, and the region is not within
     SDRAM, we 'continue'.
3. check_fbmem_region seems unnecessary.
   - we know rg.type is OMAPFB_MEMTYPE_SDRAM
   - we can check rg.size independently
   - bootmem_reserve() can check for overlapping reservations itself
   - we've already validated that the requested region lies within SDRAM.
4. avoid BUG()ing if the region entry is already set; print an error,
   and mark the configuration invalid - at least we'll continue booting
   so the error message has a chance of being logged/visible via serial
   console.

With these changes in place, it makes the code much easier to understand
and hence easier to convert to LMB.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-07-16 11:06:41 +01:00
..
include/plat Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2010-05-21 14:46:51 -07:00
Kconfig omap iommu: Make CONFIG_OMAP_IOMMU_DEBUG selectable 2010-05-14 10:23:34 +03:00
Makefile
clock.c OMAP4 clock: Support clk_set_parent 2010-05-20 12:31:12 -06:00
common.c omap4: Move SOC specific code from board file 2010-05-20 11:17:51 -07:00
cpu-omap.c
debug-devices.c
debug-leds.c
devices.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
dma.c omap: DMA: Fix multi-line comments 2010-05-20 11:16:39 -07:00
dmtimer.c omap: DMTIMER: Ack pending interrupt always when stopping a timer 2010-06-10 15:37:41 +03:00
fb.c ARM: OMAP: Cleanup OMAP FB SDRAM reservation 2010-07-16 11:06:41 +01:00
gpio.c omap: GPIO: fix auto-disable of debounce clock 2010-06-10 15:37:41 +03:00
i2c.c omap4: Add support for i2c init 2010-05-20 11:36:43 -07:00
io.c Merge with mainline to remove plat-omap/Kconfig conflict 2010-03-01 14:19:05 -08:00
iommu-debug.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
iommu.c omap iommu: Reject unaligned addresses at setting page table entry 2010-05-14 10:23:39 +03:00
iopgtable.h
iovmm.c omap iommu: Fix Memory leak 2010-06-09 13:21:27 +03:00
mailbox.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mcbsp.c Merge branch 'topic/asoc' into for-linus 2010-05-20 12:00:43 +02:00
mux.c
ocpi.c
omap-pm-noop.c
omap_device.c OMAP powerdomain, hwmod, omap_device: add some credits 2010-05-20 12:31:14 -06:00
sram.c omap4: Fix multiboot with CONFIG_PM and CONFIG_ARCH_OMAP3 selected 2010-05-04 13:19:16 -07:00
usb.c