Skip to content

Commit

Permalink
Merge branches 'devel-mux' and 'devel-misc' into omap-for-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Lindgren committed Mar 14, 2011
2 parents 17fe12c + 02b7b94 commit 05f6894
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 25 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-h4.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ static void __init omap_h4_init_early(void)
static void __init omap_h4_init_irq(void)
{
omap_init_irq();
h4_init_flash();
}

static struct at24_platform_data m24c01 = {
Expand Down Expand Up @@ -372,6 +371,7 @@ static void __init omap_h4_init(void)
platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
omap2_usbfs_init(&h4_usb_config);
omap_serial_init();
h4_init_flash();
}

static void __init omap_h4_map_io(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/board-zoom.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void __init omap_zoom_init_early(void)
#ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = {
/* WLAN IRQ - GPIO 162 */
OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
/* WLAN POWER ENABLE - GPIO 101 */
OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
/* WLAN SDIO: MMC3 CMD */
Expand Down
13 changes: 13 additions & 0 deletions arch/arm/mach-omap2/id.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ EXPORT_SYMBOL(omap_type);
#define OMAP_TAP_DIE_ID_2 0x0220
#define OMAP_TAP_DIE_ID_3 0x0224

#define OMAP_TAP_DIE_ID_44XX_0 0x0200
#define OMAP_TAP_DIE_ID_44XX_1 0x0208
#define OMAP_TAP_DIE_ID_44XX_2 0x020c
#define OMAP_TAP_DIE_ID_44XX_3 0x0210

#define read_tap_reg(reg) __raw_readl(tap_base + (reg))

struct omap_id {
Expand All @@ -107,6 +112,14 @@ static u16 tap_prod_id;

void omap_get_die_id(struct omap_die_id *odi)
{
if (cpu_is_omap44xx()) {
odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_3);

return;
}
odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0);
odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1);
odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2);
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/plat-omap/include/plat/iovmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ struct iovm_struct {
#define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT))

#define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT))
#define IOVMF_DA_ANON (2 << (4 + IOVMF_SW_SHIFT))
#define IOVMF_DA_MASK (3 << (4 + IOVMF_SW_SHIFT))


extern struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da);
Expand Down
14 changes: 8 additions & 6 deletions arch/arm/plat-omap/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,11 +982,6 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
err = -ENODEV;
goto err_mem;
}
obj->regbase = ioremap(res->start, resource_size(res));
if (!obj->regbase) {
err = -ENOMEM;
goto err_mem;
}

res = request_mem_region(res->start, resource_size(res),
dev_name(&pdev->dev));
Expand All @@ -995,6 +990,12 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
goto err_mem;
}

obj->regbase = ioremap(res->start, resource_size(res));
if (!obj->regbase) {
err = -ENOMEM;
goto err_ioremap;
}

irq = platform_get_irq(pdev, 0);
if (irq < 0) {
err = -ENODEV;
Expand Down Expand Up @@ -1023,8 +1024,9 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
err_pgd:
free_irq(irq, obj);
err_irq:
release_mem_region(res->start, resource_size(res));
iounmap(obj->regbase);
err_ioremap:
release_mem_region(res->start, resource_size(res));
err_mem:
clk_put(obj->clk);
err_clk:
Expand Down
27 changes: 12 additions & 15 deletions arch/arm/plat-omap/iovmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,20 +271,21 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
size_t bytes, u32 flags)
{
struct iovm_struct *new, *tmp;
u32 start, prev_end, alignement;
u32 start, prev_end, alignment;

if (!obj || !bytes)
return ERR_PTR(-EINVAL);

start = da;
alignement = PAGE_SIZE;
alignment = PAGE_SIZE;

if (flags & IOVMF_DA_ANON) {
start = obj->da_start;
if (~flags & IOVMF_DA_FIXED) {
/* Don't map address 0 */
start = obj->da_start ? obj->da_start : alignment;

if (flags & IOVMF_LINEAR)
alignement = iopgsz_max(bytes);
start = roundup(start, alignement);
alignment = iopgsz_max(bytes);
start = roundup(start, alignment);
} else if (start < obj->da_start || start > obj->da_end ||
obj->da_end - start < bytes) {
return ERR_PTR(-EINVAL);
Expand All @@ -303,8 +304,8 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
if (tmp->da_start > start && (tmp->da_start - start) >= bytes)
goto found;

if (tmp->da_end >= start && flags & IOVMF_DA_ANON)
start = roundup(tmp->da_end + 1, alignement);
if (tmp->da_end >= start && ~flags & IOVMF_DA_FIXED)
start = roundup(tmp->da_end + 1, alignment);

prev_end = tmp->da_end;
}
Expand Down Expand Up @@ -650,7 +651,6 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
flags &= IOVMF_HW_MASK;
flags |= IOVMF_DISCONT;
flags |= IOVMF_MMIO;
flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);

da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
if (IS_ERR_VALUE(da))
Expand Down Expand Up @@ -690,7 +690,7 @@ EXPORT_SYMBOL_GPL(iommu_vunmap);
* @flags: iovma and page property
*
* Allocate @bytes linearly and creates 1-n-1 mapping and returns
* @da again, which might be adjusted if 'IOVMF_DA_ANON' is set.
* @da again, which might be adjusted if 'IOVMF_DA_FIXED' is not set.
*/
u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
{
Expand All @@ -709,7 +709,6 @@ u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
flags &= IOVMF_HW_MASK;
flags |= IOVMF_DISCONT;
flags |= IOVMF_ALLOC;
flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);

sgt = sgtable_alloc(bytes, flags, da, 0);
if (IS_ERR(sgt)) {
Expand Down Expand Up @@ -780,7 +779,7 @@ static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va,
* @flags: iovma and page property
*
* Creates 1-1-1 mapping and returns @da again, which can be
* adjusted if 'IOVMF_DA_ANON' is set.
* adjusted if 'IOVMF_DA_FIXED' is not set.
*/
u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
u32 flags)
Expand All @@ -799,7 +798,6 @@ u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
flags &= IOVMF_HW_MASK;
flags |= IOVMF_LINEAR;
flags |= IOVMF_MMIO;
flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);

da = __iommu_kmap(obj, da, pa, va, bytes, flags);
if (IS_ERR_VALUE(da))
Expand Down Expand Up @@ -838,7 +836,7 @@ EXPORT_SYMBOL_GPL(iommu_kunmap);
* @flags: iovma and page property
*
* Allocate @bytes linearly and creates 1-1-1 mapping and returns
* @da again, which might be adjusted if 'IOVMF_DA_ANON' is set.
* @da again, which might be adjusted if 'IOVMF_DA_FIXED' is not set.
*/
u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
{
Expand All @@ -858,7 +856,6 @@ u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
flags &= IOVMF_HW_MASK;
flags |= IOVMF_LINEAR;
flags |= IOVMF_ALLOC;
flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);

da = __iommu_kmap(obj, da, pa, va, bytes, flags);
if (IS_ERR_VALUE(da))
Expand Down

0 comments on commit 05f6894

Please sign in to comment.