Commit 05f68940 authored by Tony Lindgren's avatar Tony Lindgren

Merge branches 'devel-mux' and 'devel-misc' into omap-for-linus

parents 17fe12c5 02b7b94e
...@@ -299,7 +299,6 @@ static void __init omap_h4_init_early(void) ...@@ -299,7 +299,6 @@ static void __init omap_h4_init_early(void)
static void __init omap_h4_init_irq(void) static void __init omap_h4_init_irq(void)
{ {
omap_init_irq(); omap_init_irq();
h4_init_flash();
} }
static struct at24_platform_data m24c01 = { static struct at24_platform_data m24c01 = {
...@@ -372,6 +371,7 @@ static void __init omap_h4_init(void) ...@@ -372,6 +371,7 @@ static void __init omap_h4_init(void)
platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
omap2_usbfs_init(&h4_usb_config); omap2_usbfs_init(&h4_usb_config);
omap_serial_init(); omap_serial_init();
h4_init_flash();
} }
static void __init omap_h4_map_io(void) static void __init omap_h4_map_io(void)
......
...@@ -48,7 +48,7 @@ static void __init omap_zoom_init_early(void) ...@@ -48,7 +48,7 @@ static void __init omap_zoom_init_early(void)
#ifdef CONFIG_OMAP_MUX #ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = { static struct omap_board_mux board_mux[] __initdata = {
/* WLAN IRQ - GPIO 162 */ /* 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 */ /* WLAN POWER ENABLE - GPIO 101 */
OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
/* WLAN SDIO: MMC3 CMD */ /* WLAN SDIO: MMC3 CMD */
......
...@@ -84,6 +84,11 @@ EXPORT_SYMBOL(omap_type); ...@@ -84,6 +84,11 @@ EXPORT_SYMBOL(omap_type);
#define OMAP_TAP_DIE_ID_2 0x0220 #define OMAP_TAP_DIE_ID_2 0x0220
#define OMAP_TAP_DIE_ID_3 0x0224 #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)) #define read_tap_reg(reg) __raw_readl(tap_base + (reg))
struct omap_id { struct omap_id {
...@@ -107,6 +112,14 @@ static u16 tap_prod_id; ...@@ -107,6 +112,14 @@ static u16 tap_prod_id;
void omap_get_die_id(struct omap_die_id *odi) 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_0 = read_tap_reg(OMAP_TAP_DIE_ID_0);
odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1); odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1);
odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2); odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2);
......
...@@ -71,8 +71,6 @@ struct iovm_struct { ...@@ -71,8 +71,6 @@ struct iovm_struct {
#define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT)) #define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT))
#define IOVMF_DA_FIXED (1 << (4 + 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); extern struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da);
......
...@@ -982,11 +982,6 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev) ...@@ -982,11 +982,6 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
err = -ENODEV; err = -ENODEV;
goto err_mem; 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), res = request_mem_region(res->start, resource_size(res),
dev_name(&pdev->dev)); dev_name(&pdev->dev));
...@@ -995,6 +990,12 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev) ...@@ -995,6 +990,12 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
goto err_mem; 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); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
err = -ENODEV; err = -ENODEV;
...@@ -1023,8 +1024,9 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev) ...@@ -1023,8 +1024,9 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
err_pgd: err_pgd:
free_irq(irq, obj); free_irq(irq, obj);
err_irq: err_irq:
release_mem_region(res->start, resource_size(res));
iounmap(obj->regbase); iounmap(obj->regbase);
err_ioremap:
release_mem_region(res->start, resource_size(res));
err_mem: err_mem:
clk_put(obj->clk); clk_put(obj->clk);
err_clk: err_clk:
......
...@@ -271,20 +271,21 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da, ...@@ -271,20 +271,21 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
size_t bytes, u32 flags) size_t bytes, u32 flags)
{ {
struct iovm_struct *new, *tmp; struct iovm_struct *new, *tmp;
u32 start, prev_end, alignement; u32 start, prev_end, alignment;
if (!obj || !bytes) if (!obj || !bytes)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
start = da; start = da;
alignement = PAGE_SIZE; alignment = PAGE_SIZE;
if (flags & IOVMF_DA_ANON) { if (~flags & IOVMF_DA_FIXED) {
start = obj->da_start; /* Don't map address 0 */
start = obj->da_start ? obj->da_start : alignment;
if (flags & IOVMF_LINEAR) if (flags & IOVMF_LINEAR)
alignement = iopgsz_max(bytes); alignment = iopgsz_max(bytes);
start = roundup(start, alignement); start = roundup(start, alignment);
} else if (start < obj->da_start || start > obj->da_end || } else if (start < obj->da_start || start > obj->da_end ||
obj->da_end - start < bytes) { obj->da_end - start < bytes) {
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
...@@ -303,8 +304,8 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da, ...@@ -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) if (tmp->da_start > start && (tmp->da_start - start) >= bytes)
goto found; goto found;
if (tmp->da_end >= start && flags & IOVMF_DA_ANON) if (tmp->da_end >= start && ~flags & IOVMF_DA_FIXED)
start = roundup(tmp->da_end + 1, alignement); start = roundup(tmp->da_end + 1, alignment);
prev_end = tmp->da_end; prev_end = tmp->da_end;
} }
...@@ -650,7 +651,6 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, ...@@ -650,7 +651,6 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
flags &= IOVMF_HW_MASK; flags &= IOVMF_HW_MASK;
flags |= IOVMF_DISCONT; flags |= IOVMF_DISCONT;
flags |= IOVMF_MMIO; flags |= IOVMF_MMIO;
flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
da = __iommu_vmap(obj, da, sgt, va, bytes, flags); da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
if (IS_ERR_VALUE(da)) if (IS_ERR_VALUE(da))
...@@ -690,7 +690,7 @@ EXPORT_SYMBOL_GPL(iommu_vunmap); ...@@ -690,7 +690,7 @@ EXPORT_SYMBOL_GPL(iommu_vunmap);
* @flags: iovma and page property * @flags: iovma and page property
* *
* Allocate @bytes linearly and creates 1-n-1 mapping and returns * 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) u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
{ {
...@@ -709,7 +709,6 @@ u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) ...@@ -709,7 +709,6 @@ u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
flags &= IOVMF_HW_MASK; flags &= IOVMF_HW_MASK;
flags |= IOVMF_DISCONT; flags |= IOVMF_DISCONT;
flags |= IOVMF_ALLOC; flags |= IOVMF_ALLOC;
flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
sgt = sgtable_alloc(bytes, flags, da, 0); sgt = sgtable_alloc(bytes, flags, da, 0);
if (IS_ERR(sgt)) { if (IS_ERR(sgt)) {
...@@ -780,7 +779,7 @@ static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va, ...@@ -780,7 +779,7 @@ static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va,
* @flags: iovma and page property * @flags: iovma and page property
* *
* Creates 1-1-1 mapping and returns @da again, which can be * 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 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
u32 flags) u32 flags)
...@@ -799,7 +798,6 @@ u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, ...@@ -799,7 +798,6 @@ u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
flags &= IOVMF_HW_MASK; flags &= IOVMF_HW_MASK;
flags |= IOVMF_LINEAR; flags |= IOVMF_LINEAR;
flags |= IOVMF_MMIO; flags |= IOVMF_MMIO;
flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
da = __iommu_kmap(obj, da, pa, va, bytes, flags); da = __iommu_kmap(obj, da, pa, va, bytes, flags);
if (IS_ERR_VALUE(da)) if (IS_ERR_VALUE(da))
...@@ -838,7 +836,7 @@ EXPORT_SYMBOL_GPL(iommu_kunmap); ...@@ -838,7 +836,7 @@ EXPORT_SYMBOL_GPL(iommu_kunmap);
* @flags: iovma and page property * @flags: iovma and page property
* *
* Allocate @bytes linearly and creates 1-1-1 mapping and returns * 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) u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
{ {
...@@ -858,7 +856,6 @@ u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) ...@@ -858,7 +856,6 @@ u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
flags &= IOVMF_HW_MASK; flags &= IOVMF_HW_MASK;
flags |= IOVMF_LINEAR; flags |= IOVMF_LINEAR;
flags |= IOVMF_ALLOC; flags |= IOVMF_ALLOC;
flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
da = __iommu_kmap(obj, da, pa, va, bytes, flags); da = __iommu_kmap(obj, da, pa, va, bytes, flags);
if (IS_ERR_VALUE(da)) if (IS_ERR_VALUE(da))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment