diff options
-rw-r--r-- | arch/arm/mach-imx/mm-imx25.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mm-imx31.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-imx/mm-imx35.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx5/mm.c | 9 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/sdma.h | 6 | ||||
-rw-r--r-- | drivers/dma/imx-sdma.c | 6 |
6 files changed, 20 insertions, 22 deletions
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c index 0c545207ce00..1e0c95651c23 100644 --- a/arch/arm/mach-imx/mm-imx25.c +++ b/arch/arm/mach-imx/mm-imx25.c | |||
@@ -80,8 +80,7 @@ static struct sdma_script_start_addrs imx25_sdma_script __initdata = { | |||
80 | 80 | ||
81 | static struct sdma_platform_data imx25_sdma_pdata __initdata = { | 81 | static struct sdma_platform_data imx25_sdma_pdata __initdata = { |
82 | .sdma_version = 2, | 82 | .sdma_version = 2, |
83 | .cpu_name = "imx25", | 83 | .fw_name = "sdma-imx25.bin", |
84 | .to_version = 1, | ||
85 | .script_addrs = &imx25_sdma_script, | 84 | .script_addrs = &imx25_sdma_script, |
86 | }; | 85 | }; |
87 | 86 | ||
diff --git a/arch/arm/mach-imx/mm-imx31.c b/arch/arm/mach-imx/mm-imx31.c index 6af8519d3d6c..a1ff96f249d1 100644 --- a/arch/arm/mach-imx/mm-imx31.c +++ b/arch/arm/mach-imx/mm-imx31.c | |||
@@ -70,7 +70,7 @@ static struct sdma_script_start_addrs imx31_to2_sdma_script __initdata = { | |||
70 | 70 | ||
71 | static struct sdma_platform_data imx31_sdma_pdata __initdata = { | 71 | static struct sdma_platform_data imx31_sdma_pdata __initdata = { |
72 | .sdma_version = 1, | 72 | .sdma_version = 1, |
73 | .cpu_name = "imx31", | 73 | .fw_name = "sdma-imx31-to2.bin", |
74 | .script_addrs = &imx31_to2_sdma_script, | 74 | .script_addrs = &imx31_to2_sdma_script, |
75 | }; | 75 | }; |
76 | 76 | ||
@@ -82,8 +82,11 @@ void __init imx31_soc_init(void) | |||
82 | mxc_register_gpio(1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0); | 82 | mxc_register_gpio(1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0); |
83 | mxc_register_gpio(2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0); | 83 | mxc_register_gpio(2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0); |
84 | 84 | ||
85 | imx31_sdma_pdata.to_version = to_version; | 85 | if (to_version == 1) { |
86 | if (to_version == 1) | 86 | strncpy(imx31_sdma_pdata.fw_name, "sdma-imx31-to1.bin", |
87 | strlen(imx31_sdma_pdata.fw_name)); | ||
87 | imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script; | 88 | imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script; |
89 | } | ||
90 | |||
88 | imx_add_imx_sdma(MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); | 91 | imx_add_imx_sdma(MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); |
89 | } | 92 | } |
diff --git a/arch/arm/mach-imx/mm-imx35.c b/arch/arm/mach-imx/mm-imx35.c index 9891adb52458..da530ca48aea 100644 --- a/arch/arm/mach-imx/mm-imx35.c +++ b/arch/arm/mach-imx/mm-imx35.c | |||
@@ -87,7 +87,7 @@ static struct sdma_script_start_addrs imx35_to2_sdma_script __initdata = { | |||
87 | 87 | ||
88 | static struct sdma_platform_data imx35_sdma_pdata __initdata = { | 88 | static struct sdma_platform_data imx35_sdma_pdata __initdata = { |
89 | .sdma_version = 2, | 89 | .sdma_version = 2, |
90 | .cpu_name = "imx35", | 90 | .fw_name = "sdma-imx35-to2.bin", |
91 | .script_addrs = &imx35_to2_sdma_script, | 91 | .script_addrs = &imx35_to2_sdma_script, |
92 | }; | 92 | }; |
93 | 93 | ||
@@ -99,8 +99,11 @@ void __init imx35_soc_init(void) | |||
99 | mxc_register_gpio(1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0); | 99 | mxc_register_gpio(1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0); |
100 | mxc_register_gpio(2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0); | 100 | mxc_register_gpio(2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0); |
101 | 101 | ||
102 | imx35_sdma_pdata.to_version = to_version; | 102 | if (to_version == 1) { |
103 | if (to_version == 1) | 103 | strncpy(imx35_sdma_pdata.fw_name, "sdma-imx35-to1.bin", |
104 | strlen(imx35_sdma_pdata.fw_name)); | ||
104 | imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script; | 105 | imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script; |
106 | } | ||
107 | |||
105 | imx_add_imx_sdma(MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata); | 108 | imx_add_imx_sdma(MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata); |
106 | } | 109 | } |
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c index aa848ea987e8..1b7059f1ac76 100644 --- a/arch/arm/mach-mx5/mm.c +++ b/arch/arm/mach-mx5/mm.c | |||
@@ -116,8 +116,7 @@ static struct sdma_script_start_addrs imx51_sdma_script __initdata = { | |||
116 | 116 | ||
117 | static struct sdma_platform_data imx51_sdma_pdata __initdata = { | 117 | static struct sdma_platform_data imx51_sdma_pdata __initdata = { |
118 | .sdma_version = 2, | 118 | .sdma_version = 2, |
119 | .cpu_name = "imx51", | 119 | .fw_name = "sdma-imx51.bin", |
120 | .to_version = 1, | ||
121 | .script_addrs = &imx51_sdma_script, | 120 | .script_addrs = &imx51_sdma_script, |
122 | }; | 121 | }; |
123 | 122 | ||
@@ -137,21 +136,17 @@ static struct sdma_script_start_addrs imx53_sdma_script __initdata = { | |||
137 | 136 | ||
138 | static struct sdma_platform_data imx53_sdma_pdata __initdata = { | 137 | static struct sdma_platform_data imx53_sdma_pdata __initdata = { |
139 | .sdma_version = 2, | 138 | .sdma_version = 2, |
140 | .cpu_name = "imx53", | 139 | .fw_name = "sdma-imx53.bin", |
141 | .to_version = 1, | ||
142 | .script_addrs = &imx53_sdma_script, | 140 | .script_addrs = &imx53_sdma_script, |
143 | }; | 141 | }; |
144 | 142 | ||
145 | void __init imx51_soc_init(void) | 143 | void __init imx51_soc_init(void) |
146 | { | 144 | { |
147 | int to_version = mx51_revision() >> 4; | ||
148 | |||
149 | mxc_register_gpio(0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH); | 145 | mxc_register_gpio(0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH); |
150 | mxc_register_gpio(1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH); | 146 | mxc_register_gpio(1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH); |
151 | mxc_register_gpio(2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH); | 147 | mxc_register_gpio(2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH); |
152 | mxc_register_gpio(3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH); | 148 | mxc_register_gpio(3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH); |
153 | 149 | ||
154 | imx51_sdma_pdata.to_version = to_version; | ||
155 | imx_add_imx_sdma(MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata); | 150 | imx_add_imx_sdma(MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata); |
156 | } | 151 | } |
157 | 152 | ||
diff --git a/arch/arm/plat-mxc/include/mach/sdma.h b/arch/arm/plat-mxc/include/mach/sdma.h index 913e0432e40e..f495c87c113f 100644 --- a/arch/arm/plat-mxc/include/mach/sdma.h +++ b/arch/arm/plat-mxc/include/mach/sdma.h | |||
@@ -49,14 +49,12 @@ struct sdma_script_start_addrs { | |||
49 | * struct sdma_platform_data - platform specific data for SDMA engine | 49 | * struct sdma_platform_data - platform specific data for SDMA engine |
50 | * | 50 | * |
51 | * @sdma_version The version of this SDMA engine | 51 | * @sdma_version The version of this SDMA engine |
52 | * @cpu_name used to generate the firmware name | 52 | * @fw_name The firmware name |
53 | * @to_version CPU Tape out version | ||
54 | * @script_addrs SDMA scripts addresses in SDMA ROM | 53 | * @script_addrs SDMA scripts addresses in SDMA ROM |
55 | */ | 54 | */ |
56 | struct sdma_platform_data { | 55 | struct sdma_platform_data { |
57 | int sdma_version; | 56 | int sdma_version; |
58 | char *cpu_name; | 57 | char *fw_name; |
59 | int to_version; | ||
60 | struct sdma_script_start_addrs *script_addrs; | 58 | struct sdma_script_start_addrs *script_addrs; |
61 | }; | 59 | }; |
62 | 60 | ||
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index b6d1455fa936..1ea47db2ff06 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -1105,7 +1105,7 @@ static void sdma_add_scripts(struct sdma_engine *sdma, | |||
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | static int __init sdma_get_firmware(struct sdma_engine *sdma, | 1107 | static int __init sdma_get_firmware(struct sdma_engine *sdma, |
1108 | const char *cpu_name, int to_version) | 1108 | const char *fw_name) |
1109 | { | 1109 | { |
1110 | const struct firmware *fw; | 1110 | const struct firmware *fw; |
1111 | char *fwname; | 1111 | char *fwname; |
@@ -1114,7 +1114,7 @@ static int __init sdma_get_firmware(struct sdma_engine *sdma, | |||
1114 | const struct sdma_script_start_addrs *addr; | 1114 | const struct sdma_script_start_addrs *addr; |
1115 | unsigned short *ram_code; | 1115 | unsigned short *ram_code; |
1116 | 1116 | ||
1117 | fwname = kasprintf(GFP_KERNEL, "sdma-%s-to%d.bin", cpu_name, to_version); | 1117 | fwname = kasprintf(GFP_KERNEL, "%s", fw_name); |
1118 | if (!fwname) | 1118 | if (!fwname) |
1119 | return -ENOMEM; | 1119 | return -ENOMEM; |
1120 | 1120 | ||
@@ -1317,7 +1317,7 @@ static int __init sdma_probe(struct platform_device *pdev) | |||
1317 | if (pdata->script_addrs) | 1317 | if (pdata->script_addrs) |
1318 | sdma_add_scripts(sdma, pdata->script_addrs); | 1318 | sdma_add_scripts(sdma, pdata->script_addrs); |
1319 | 1319 | ||
1320 | sdma_get_firmware(sdma, pdata->cpu_name, pdata->to_version); | 1320 | sdma_get_firmware(sdma, pdata->fw_name); |
1321 | 1321 | ||
1322 | sdma->dma_device.dev = &pdev->dev; | 1322 | sdma->dma_device.dev = &pdev->dev; |
1323 | 1323 | ||