Commit b567902d9d767867fdbf09ebb9a086bdb51bc0f1
1 parent
e82e4564f4
Exists in
v3.2_SMARCT335xPSP_04.06.00.11
and in
2 other branches
Add 0001-ARM-AM33xx-hwmod-Convert-SHA0-crypto-device-data-to-.patch that wasn't …
…part of the official PSP 04.06.00.11 release
Showing 2 changed files with 39 additions and 61 deletions Side-by-side Diff
arch/arm/mach-omap2/devices.c
... | ... | @@ -708,72 +708,18 @@ |
708 | 708 | } |
709 | 709 | |
710 | 710 | #elif defined(CONFIG_CRYPTO_DEV_OMAP4_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP4_SHAM_MODULE) |
711 | - | |
712 | -static struct resource omap4_sham_resources[] = { | |
713 | - { | |
714 | - .start = AM33XX_SHA1MD5_P_BASE, | |
715 | - .end = AM33XX_SHA1MD5_P_BASE + 0x120, | |
716 | - .flags = IORESOURCE_MEM, | |
717 | - }, | |
718 | - { | |
719 | - .start = AM33XX_IRQ_SHAEIP57t0_P, | |
720 | - .flags = IORESOURCE_IRQ, | |
721 | - }, | |
722 | - { | |
723 | - .start = AM33XX_DMA_SHAEIP57T0_DIN, | |
724 | - .flags = IORESOURCE_DMA, | |
725 | - } | |
726 | -}; | |
727 | - | |
728 | -static int omap4_sham_resources_sz = ARRAY_SIZE(omap4_sham_resources); | |
729 | - | |
730 | - | |
731 | -static struct platform_device sham_device = { | |
732 | - .name = "omap4-sham", | |
733 | - .id = -1, | |
734 | -}; | |
735 | - | |
736 | -#if 0 | |
737 | -static void omap_init_sham(void) | |
711 | +static void __init omap_init_sham(void) | |
738 | 712 | { |
739 | - sham_device.resource = omap4_sham_resources; | |
740 | - sham_device.num_resources = omap4_sham_resources_sz; | |
741 | - | |
742 | - platform_device_register(&sham_device); | |
743 | -} | |
744 | -#endif | |
745 | - | |
746 | -int __init omap_init_sham(void) | |
747 | -{ | |
748 | - int id = -1; | |
749 | - struct platform_device *pdev; | |
750 | 713 | struct omap_hwmod *oh; |
751 | - char *oh_name = "sha0"; | |
752 | - char *name = "omap4-sham"; | |
714 | + struct platform_device *pdev; | |
753 | 715 | |
754 | - oh = omap_hwmod_lookup(oh_name); | |
755 | - if (!oh) { | |
756 | - pr_err("Could not look up %s\n", oh_name); | |
757 | - return -ENODEV; | |
758 | - } | |
716 | + oh = omap_hwmod_lookup("sha0"); | |
717 | + if (!oh) | |
718 | + return; | |
759 | 719 | |
760 | - pdev = omap_device_build(name, id, oh, NULL, 0, NULL, 0, 0); | |
761 | - //pdev.resource = omap4_sham_resources; | |
762 | - //pdev.num_resources = omap4_sham_resources_sz; | |
763 | - | |
764 | - if (IS_ERR(pdev)) { | |
765 | - WARN(1, "Can't build omap_device for %s:%s.\n", | |
766 | - name, oh->name); | |
767 | - return PTR_ERR(pdev); | |
768 | - } | |
769 | - | |
770 | - return 0; | |
720 | + pdev = omap_device_build("omap4-sham", -1, oh, NULL, 0, NULL, 0, 0); | |
721 | + WARN(IS_ERR(pdev), "Can't build omap_device for omap-sham\n"); | |
771 | 722 | } |
772 | - | |
773 | - | |
774 | - | |
775 | - | |
776 | - | |
777 | 723 | #else |
778 | 724 | static inline void omap_init_sham(void) { } |
779 | 725 | #endif |
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
... | ... | @@ -79,6 +79,7 @@ |
79 | 79 | static struct omap_hwmod am33xx_elm_hwmod; |
80 | 80 | static struct omap_hwmod am33xx_adc_tsc_hwmod; |
81 | 81 | static struct omap_hwmod am33xx_rtc_hwmod; |
82 | +static struct omap_hwmod am33xx_sha0_hwmod; | |
82 | 83 | static struct omap_hwmod am33xx_mcasp0_hwmod; |
83 | 84 | static struct omap_hwmod am33xx_mcasp1_hwmod; |
84 | 85 | static struct omap_hwmod am33xx_ehrpwm0_hwmod; |
85 | 86 | |
... | ... | @@ -2167,8 +2168,16 @@ |
2167 | 2168 | }; |
2168 | 2169 | |
2169 | 2170 | /* sha0 */ |
2171 | +static struct omap_hwmod_class_sysconfig am33xx_sha0_sysc = { | |
2172 | + .rev_offs = 0x100, | |
2173 | + .sysc_offs = 0x110, | |
2174 | + .syss_offs = 0x114, | |
2175 | + .sysc_flags = SYSS_HAS_RESET_STATUS, | |
2176 | +}; | |
2177 | + | |
2170 | 2178 | static struct omap_hwmod_class am33xx_sha0_hwmod_class = { |
2171 | 2179 | .name = "sha0", |
2180 | + .sysc = &am33xx_sha0_sysc, | |
2172 | 2181 | }; |
2173 | 2182 | |
2174 | 2183 | static struct omap_hwmod_irq_info am33xx_sha0_irqs[] = { |
... | ... | @@ -2181,6 +2190,27 @@ |
2181 | 2190 | { .dma_req = -1 } |
2182 | 2191 | }; |
2183 | 2192 | |
2193 | +struct omap_hwmod_addr_space am33xx_sha0_addr_space[] = { | |
2194 | + { | |
2195 | + .pa_start = 0x53100000, | |
2196 | + .pa_end = 0x53100000 + SZ_1M - 1, | |
2197 | + .flags = ADDR_TYPE_RT, | |
2198 | + }, | |
2199 | + { } | |
2200 | +}; | |
2201 | + | |
2202 | +struct omap_hwmod_ocp_if am33xx_l3_core__sha0 = { | |
2203 | + .master = &am33xx_l3_main_hwmod, | |
2204 | + .slave = &am33xx_sha0_hwmod, | |
2205 | + .clk = "sha0_fck", | |
2206 | + .addr = am33xx_sha0_addr_space, | |
2207 | + .user = OCP_USER_MPU, | |
2208 | +}; | |
2209 | + | |
2210 | +static struct omap_hwmod_ocp_if *am33xx_sha0_slaves[] = { | |
2211 | + &am33xx_l3_core__sha0, | |
2212 | +}; | |
2213 | + | |
2184 | 2214 | static struct omap_hwmod am33xx_sha0_hwmod = { |
2185 | 2215 | .name = "sha0", |
2186 | 2216 | .class = &am33xx_sha0_hwmod_class, |
... | ... | @@ -2194,6 +2224,8 @@ |
2194 | 2224 | .modulemode = MODULEMODE_SWCTRL, |
2195 | 2225 | }, |
2196 | 2226 | }, |
2227 | + .slaves = am33xx_sha0_slaves, | |
2228 | + .slaves_cnt = ARRAY_SIZE(am33xx_sha0_slaves), | |
2197 | 2229 | }; |
2198 | 2230 | |
2199 | 2231 | /* 'smartreflex' class */ |