diff options
author | Tony Lindgren <tony@atomide.com> | 2011-03-14 14:22:22 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-03-14 14:22:22 -0400 |
commit | 05f689400ea5fa3d71af82f910c8b140f87ad1f3 (patch) | |
tree | 39fa8ddb5163661361dbc5b2ab11f4e331492ead | |
parent | 17fe12c5a7bd674c1e6dca9cf1e250f9cd7b96b1 (diff) | |
parent | 02b7b94ee98a0a463195d148e5c5885a218ee16f (diff) |
Merge branches 'devel-mux' and 'devel-misc' into omap-for-linus
-rw-r--r-- | arch/arm/mach-omap2/board-h4.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-zoom.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/id.c | 13 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/iovmm.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/iommu.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-omap/iovmm.c | 27 |
6 files changed, 35 insertions, 25 deletions
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 7e6bf4fa1535..bac7933b8cbb 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -299,7 +299,6 @@ static void __init omap_h4_init_early(void) | |||
299 | static void __init omap_h4_init_irq(void) | 299 | static void __init omap_h4_init_irq(void) |
300 | { | 300 | { |
301 | omap_init_irq(); | 301 | omap_init_irq(); |
302 | h4_init_flash(); | ||
303 | } | 302 | } |
304 | 303 | ||
305 | static struct at24_platform_data m24c01 = { | 304 | static struct at24_platform_data m24c01 = { |
@@ -372,6 +371,7 @@ static void __init omap_h4_init(void) | |||
372 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); | 371 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); |
373 | omap2_usbfs_init(&h4_usb_config); | 372 | omap2_usbfs_init(&h4_usb_config); |
374 | omap_serial_init(); | 373 | omap_serial_init(); |
374 | h4_init_flash(); | ||
375 | } | 375 | } |
376 | 376 | ||
377 | static void __init omap_h4_map_io(void) | 377 | static void __init omap_h4_map_io(void) |
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c index 7e3f1595d77b..7e895ff39220 100644 --- a/arch/arm/mach-omap2/board-zoom.c +++ b/arch/arm/mach-omap2/board-zoom.c | |||
@@ -48,7 +48,7 @@ static void __init omap_zoom_init_early(void) | |||
48 | #ifdef CONFIG_OMAP_MUX | 48 | #ifdef CONFIG_OMAP_MUX |
49 | static struct omap_board_mux board_mux[] __initdata = { | 49 | static struct omap_board_mux board_mux[] __initdata = { |
50 | /* WLAN IRQ - GPIO 162 */ | 50 | /* WLAN IRQ - GPIO 162 */ |
51 | OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), | 51 | OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), |
52 | /* WLAN POWER ENABLE - GPIO 101 */ | 52 | /* WLAN POWER ENABLE - GPIO 101 */ |
53 | OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | 53 | OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
54 | /* WLAN SDIO: MMC3 CMD */ | 54 | /* WLAN SDIO: MMC3 CMD */ |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 3168b17bc264..2537090aa33a 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -84,6 +84,11 @@ EXPORT_SYMBOL(omap_type); | |||
84 | #define OMAP_TAP_DIE_ID_2 0x0220 | 84 | #define OMAP_TAP_DIE_ID_2 0x0220 |
85 | #define OMAP_TAP_DIE_ID_3 0x0224 | 85 | #define OMAP_TAP_DIE_ID_3 0x0224 |
86 | 86 | ||
87 | #define OMAP_TAP_DIE_ID_44XX_0 0x0200 | ||
88 | #define OMAP_TAP_DIE_ID_44XX_1 0x0208 | ||
89 | #define OMAP_TAP_DIE_ID_44XX_2 0x020c | ||
90 | #define OMAP_TAP_DIE_ID_44XX_3 0x0210 | ||
91 | |||
87 | #define read_tap_reg(reg) __raw_readl(tap_base + (reg)) | 92 | #define read_tap_reg(reg) __raw_readl(tap_base + (reg)) |
88 | 93 | ||
89 | struct omap_id { | 94 | struct omap_id { |
@@ -107,6 +112,14 @@ static u16 tap_prod_id; | |||
107 | 112 | ||
108 | void omap_get_die_id(struct omap_die_id *odi) | 113 | void omap_get_die_id(struct omap_die_id *odi) |
109 | { | 114 | { |
115 | if (cpu_is_omap44xx()) { | ||
116 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0); | ||
117 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1); | ||
118 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2); | ||
119 | odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_3); | ||
120 | |||
121 | return; | ||
122 | } | ||
110 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0); | 123 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0); |
111 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1); | 124 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1); |
112 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2); | 125 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2); |
diff --git a/arch/arm/plat-omap/include/plat/iovmm.h b/arch/arm/plat-omap/include/plat/iovmm.h index bdc7ce5d7a4a..32a2f6c4d39e 100644 --- a/arch/arm/plat-omap/include/plat/iovmm.h +++ b/arch/arm/plat-omap/include/plat/iovmm.h | |||
@@ -71,8 +71,6 @@ struct iovm_struct { | |||
71 | #define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT)) | 71 | #define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT)) |
72 | 72 | ||
73 | #define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT)) | 73 | #define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT)) |
74 | #define IOVMF_DA_ANON (2 << (4 + IOVMF_SW_SHIFT)) | ||
75 | #define IOVMF_DA_MASK (3 << (4 + IOVMF_SW_SHIFT)) | ||
76 | 74 | ||
77 | 75 | ||
78 | extern struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da); | 76 | extern struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da); |
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index e3eb0380090a..8a51fd58f656 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
@@ -982,11 +982,6 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev) | |||
982 | err = -ENODEV; | 982 | err = -ENODEV; |
983 | goto err_mem; | 983 | goto err_mem; |
984 | } | 984 | } |
985 | obj->regbase = ioremap(res->start, resource_size(res)); | ||
986 | if (!obj->regbase) { | ||
987 | err = -ENOMEM; | ||
988 | goto err_mem; | ||
989 | } | ||
990 | 985 | ||
991 | res = request_mem_region(res->start, resource_size(res), | 986 | res = request_mem_region(res->start, resource_size(res), |
992 | dev_name(&pdev->dev)); | 987 | dev_name(&pdev->dev)); |
@@ -995,6 +990,12 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev) | |||
995 | goto err_mem; | 990 | goto err_mem; |
996 | } | 991 | } |
997 | 992 | ||
993 | obj->regbase = ioremap(res->start, resource_size(res)); | ||
994 | if (!obj->regbase) { | ||
995 | err = -ENOMEM; | ||
996 | goto err_ioremap; | ||
997 | } | ||
998 | |||
998 | irq = platform_get_irq(pdev, 0); | 999 | irq = platform_get_irq(pdev, 0); |
999 | if (irq < 0) { | 1000 | if (irq < 0) { |
1000 | err = -ENODEV; | 1001 | err = -ENODEV; |
@@ -1023,8 +1024,9 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev) | |||
1023 | err_pgd: | 1024 | err_pgd: |
1024 | free_irq(irq, obj); | 1025 | free_irq(irq, obj); |
1025 | err_irq: | 1026 | err_irq: |
1026 | release_mem_region(res->start, resource_size(res)); | ||
1027 | iounmap(obj->regbase); | 1027 | iounmap(obj->regbase); |
1028 | err_ioremap: | ||
1029 | release_mem_region(res->start, resource_size(res)); | ||
1028 | err_mem: | 1030 | err_mem: |
1029 | clk_put(obj->clk); | 1031 | clk_put(obj->clk); |
1030 | err_clk: | 1032 | err_clk: |
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index 6dc1296c8c77..51ef43e8def6 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c | |||
@@ -271,20 +271,21 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da, | |||
271 | size_t bytes, u32 flags) | 271 | size_t bytes, u32 flags) |
272 | { | 272 | { |
273 | struct iovm_struct *new, *tmp; | 273 | struct iovm_struct *new, *tmp; |
274 | u32 start, prev_end, alignement; | 274 | u32 start, prev_end, alignment; |
275 | 275 | ||
276 | if (!obj || !bytes) | 276 | if (!obj || !bytes) |
277 | return ERR_PTR(-EINVAL); | 277 | return ERR_PTR(-EINVAL); |
278 | 278 | ||
279 | start = da; | 279 | start = da; |
280 | alignement = PAGE_SIZE; | 280 | alignment = PAGE_SIZE; |
281 | 281 | ||
282 | if (flags & IOVMF_DA_ANON) { | 282 | if (~flags & IOVMF_DA_FIXED) { |
283 | start = obj->da_start; | 283 | /* Don't map address 0 */ |
284 | start = obj->da_start ? obj->da_start : alignment; | ||
284 | 285 | ||
285 | if (flags & IOVMF_LINEAR) | 286 | if (flags & IOVMF_LINEAR) |
286 | alignement = iopgsz_max(bytes); | 287 | alignment = iopgsz_max(bytes); |
287 | start = roundup(start, alignement); | 288 | start = roundup(start, alignment); |
288 | } else if (start < obj->da_start || start > obj->da_end || | 289 | } else if (start < obj->da_start || start > obj->da_end || |
289 | obj->da_end - start < bytes) { | 290 | obj->da_end - start < bytes) { |
290 | return ERR_PTR(-EINVAL); | 291 | return ERR_PTR(-EINVAL); |
@@ -303,8 +304,8 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da, | |||
303 | if (tmp->da_start > start && (tmp->da_start - start) >= bytes) | 304 | if (tmp->da_start > start && (tmp->da_start - start) >= bytes) |
304 | goto found; | 305 | goto found; |
305 | 306 | ||
306 | if (tmp->da_end >= start && flags & IOVMF_DA_ANON) | 307 | if (tmp->da_end >= start && ~flags & IOVMF_DA_FIXED) |
307 | start = roundup(tmp->da_end + 1, alignement); | 308 | start = roundup(tmp->da_end + 1, alignment); |
308 | 309 | ||
309 | prev_end = tmp->da_end; | 310 | prev_end = tmp->da_end; |
310 | } | 311 | } |
@@ -650,7 +651,6 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, | |||
650 | flags &= IOVMF_HW_MASK; | 651 | flags &= IOVMF_HW_MASK; |
651 | flags |= IOVMF_DISCONT; | 652 | flags |= IOVMF_DISCONT; |
652 | flags |= IOVMF_MMIO; | 653 | flags |= IOVMF_MMIO; |
653 | flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON); | ||
654 | 654 | ||
655 | da = __iommu_vmap(obj, da, sgt, va, bytes, flags); | 655 | da = __iommu_vmap(obj, da, sgt, va, bytes, flags); |
656 | if (IS_ERR_VALUE(da)) | 656 | if (IS_ERR_VALUE(da)) |
@@ -690,7 +690,7 @@ EXPORT_SYMBOL_GPL(iommu_vunmap); | |||
690 | * @flags: iovma and page property | 690 | * @flags: iovma and page property |
691 | * | 691 | * |
692 | * Allocate @bytes linearly and creates 1-n-1 mapping and returns | 692 | * Allocate @bytes linearly and creates 1-n-1 mapping and returns |
693 | * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set. | 693 | * @da again, which might be adjusted if 'IOVMF_DA_FIXED' is not set. |
694 | */ | 694 | */ |
695 | u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) | 695 | u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) |
696 | { | 696 | { |
@@ -709,7 +709,6 @@ u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) | |||
709 | flags &= IOVMF_HW_MASK; | 709 | flags &= IOVMF_HW_MASK; |
710 | flags |= IOVMF_DISCONT; | 710 | flags |= IOVMF_DISCONT; |
711 | flags |= IOVMF_ALLOC; | 711 | flags |= IOVMF_ALLOC; |
712 | flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON); | ||
713 | 712 | ||
714 | sgt = sgtable_alloc(bytes, flags, da, 0); | 713 | sgt = sgtable_alloc(bytes, flags, da, 0); |
715 | if (IS_ERR(sgt)) { | 714 | if (IS_ERR(sgt)) { |
@@ -780,7 +779,7 @@ static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va, | |||
780 | * @flags: iovma and page property | 779 | * @flags: iovma and page property |
781 | * | 780 | * |
782 | * Creates 1-1-1 mapping and returns @da again, which can be | 781 | * Creates 1-1-1 mapping and returns @da again, which can be |
783 | * adjusted if 'IOVMF_DA_ANON' is set. | 782 | * adjusted if 'IOVMF_DA_FIXED' is not set. |
784 | */ | 783 | */ |
785 | u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, | 784 | u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, |
786 | u32 flags) | 785 | u32 flags) |
@@ -799,7 +798,6 @@ u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, | |||
799 | flags &= IOVMF_HW_MASK; | 798 | flags &= IOVMF_HW_MASK; |
800 | flags |= IOVMF_LINEAR; | 799 | flags |= IOVMF_LINEAR; |
801 | flags |= IOVMF_MMIO; | 800 | flags |= IOVMF_MMIO; |
802 | flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON); | ||
803 | 801 | ||
804 | da = __iommu_kmap(obj, da, pa, va, bytes, flags); | 802 | da = __iommu_kmap(obj, da, pa, va, bytes, flags); |
805 | if (IS_ERR_VALUE(da)) | 803 | if (IS_ERR_VALUE(da)) |
@@ -838,7 +836,7 @@ EXPORT_SYMBOL_GPL(iommu_kunmap); | |||
838 | * @flags: iovma and page property | 836 | * @flags: iovma and page property |
839 | * | 837 | * |
840 | * Allocate @bytes linearly and creates 1-1-1 mapping and returns | 838 | * Allocate @bytes linearly and creates 1-1-1 mapping and returns |
841 | * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set. | 839 | * @da again, which might be adjusted if 'IOVMF_DA_FIXED' is not set. |
842 | */ | 840 | */ |
843 | u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) | 841 | u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) |
844 | { | 842 | { |
@@ -858,7 +856,6 @@ u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) | |||
858 | flags &= IOVMF_HW_MASK; | 856 | flags &= IOVMF_HW_MASK; |
859 | flags |= IOVMF_LINEAR; | 857 | flags |= IOVMF_LINEAR; |
860 | flags |= IOVMF_ALLOC; | 858 | flags |= IOVMF_ALLOC; |
861 | flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON); | ||
862 | 859 | ||
863 | da = __iommu_kmap(obj, da, pa, va, bytes, flags); | 860 | da = __iommu_kmap(obj, da, pa, va, bytes, flags); |
864 | if (IS_ERR_VALUE(da)) | 861 | if (IS_ERR_VALUE(da)) |