Commit 9a5549de335c6b846a5b2fb5af7cad4cdec25888
1 parent
77d08d3dbe
Exists in
v3.2_SMARCT335xPSP_04.06.00.11
and in
2 other branches
Add 0005-ARM-AM33xx-hwmod-Convert-AES0-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 58 deletions Side-by-side Diff
arch/arm/mach-omap2/devices.c
... | ... | @@ -791,69 +791,18 @@ |
791 | 791 | } |
792 | 792 | |
793 | 793 | #elif defined(CONFIG_CRYPTO_DEV_OMAP4_AES) || defined(CONFIG_CRYPTO_DEV_OMAP4_AES_MODULE) |
794 | - | |
795 | -static struct resource omap4_aes_resources[] = { | |
796 | - { | |
797 | - .start = AM33XX_AES0_P_BASE, | |
798 | - .end = AM33XX_AES0_P_BASE + 0x4C, | |
799 | - .flags = IORESOURCE_MEM, | |
800 | - }, | |
801 | - { | |
802 | - .start = AM33XX_DMA_AESEIP36T0_DOUT, | |
803 | - .flags = IORESOURCE_DMA, | |
804 | - }, | |
805 | - { | |
806 | - .start = AM33XX_DMA_AESEIP36T0_DIN, | |
807 | - .flags = IORESOURCE_DMA, | |
808 | - } | |
809 | -}; | |
810 | -static int omap4_aes_resources_sz = ARRAY_SIZE(omap4_aes_resources); | |
811 | - | |
812 | -static struct platform_device aes_device = { | |
813 | - .name = "omap4-aes", | |
814 | - .id = -1, | |
815 | -}; | |
816 | - | |
817 | -#if 0 | |
818 | -static void omap_init_aes(void) | |
794 | +static void __init omap_init_aes(void) | |
819 | 795 | { |
820 | - aes_device.resource = omap4_aes_resources; | |
821 | - aes_device.num_resources = omap4_aes_resources_sz; | |
822 | - platform_device_register(&aes_device); | |
823 | -} | |
824 | -#endif | |
825 | - | |
826 | -int __init omap_init_aes(void) | |
827 | -{ | |
828 | - int id = -1; | |
829 | - struct platform_device *pdev; | |
830 | 796 | struct omap_hwmod *oh; |
831 | - char *oh_name = "aes0"; | |
832 | - char *name = "omap4-aes"; | |
797 | + struct platform_device *pdev; | |
833 | 798 | |
834 | - oh = omap_hwmod_lookup(oh_name); | |
835 | - if (!oh) { | |
836 | - pr_err("Could not look up %s\n", oh_name); | |
837 | - return -ENODEV; | |
838 | - } | |
799 | + oh = omap_hwmod_lookup("aes0"); | |
800 | + if (!oh) | |
801 | + return; | |
839 | 802 | |
840 | - pdev = omap_device_build(name, id, oh, NULL, 0, NULL, 0, 0); | |
841 | - //pdev.resource = omap4_sham_resources; | |
842 | - //pdev.num_resources = omap4_sham_resources_sz; | |
843 | - | |
844 | - if (IS_ERR(pdev)) { | |
845 | - WARN(1, "Can't build omap_device for %s:%s.\n", | |
846 | - name, oh->name); | |
847 | - return PTR_ERR(pdev); | |
848 | - } | |
849 | - | |
850 | - return 0; | |
803 | + pdev = omap_device_build("omap4-aes", -1, oh, NULL, 0, NULL, 0, 0); | |
804 | + WARN(IS_ERR(pdev), "Can't build omap_device for omap-aes\n"); | |
851 | 805 | } |
852 | - | |
853 | - | |
854 | - | |
855 | - | |
856 | - | |
857 | 806 | #else |
858 | 807 | static inline void omap_init_aes(void) { } |
859 | 808 | #endif |
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
... | ... | @@ -78,6 +78,7 @@ |
78 | 78 | static struct omap_hwmod am33xx_spi1_hwmod; |
79 | 79 | static struct omap_hwmod am33xx_elm_hwmod; |
80 | 80 | static struct omap_hwmod am33xx_adc_tsc_hwmod; |
81 | +static struct omap_hwmod am33xx_aes0_hwmod; | |
81 | 82 | static struct omap_hwmod am33xx_rtc_hwmod; |
82 | 83 | static struct omap_hwmod am33xx_sha0_hwmod; |
83 | 84 | static struct omap_hwmod am33xx_mcasp0_hwmod; |
84 | 85 | |
... | ... | @@ -427,8 +428,16 @@ |
427 | 428 | }; |
428 | 429 | |
429 | 430 | /* 'aes' class */ |
431 | +static struct omap_hwmod_class_sysconfig am33xx_aes_sysc = { | |
432 | + .rev_offs = 0x80, | |
433 | + .sysc_offs = 0x84, | |
434 | + .syss_offs = 0x88, | |
435 | + .sysc_flags = SYSS_HAS_RESET_STATUS, | |
436 | +}; | |
437 | + | |
430 | 438 | static struct omap_hwmod_class am33xx_aes_hwmod_class = { |
431 | 439 | .name = "aes", |
440 | + .sysc = &am33xx_aes_sysc, | |
432 | 441 | }; |
433 | 442 | |
434 | 443 | /* aes0 */ |
... | ... | @@ -443,6 +452,27 @@ |
443 | 452 | { .dma_req = -1 } |
444 | 453 | }; |
445 | 454 | |
455 | +static struct omap_hwmod_addr_space am33xx_aes0_addrs[] = { | |
456 | + { | |
457 | + .pa_start = 0x53500000, | |
458 | + .pa_end = 0x53500000 + SZ_1M - 1, | |
459 | + .flags = ADDR_TYPE_RT | |
460 | + }, | |
461 | + { } | |
462 | +}; | |
463 | + | |
464 | +static struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = { | |
465 | + .master = &am33xx_l3_main_hwmod, | |
466 | + .slave = &am33xx_aes0_hwmod, | |
467 | + .clk = "aes0_fck", | |
468 | + .addr = am33xx_aes0_addrs, | |
469 | + .user = OCP_USER_MPU | OCP_USER_SDMA, | |
470 | +}; | |
471 | + | |
472 | +static struct omap_hwmod_ocp_if *am33xx_aes0_slaves[] = { | |
473 | + &am33xx_l3_main__aes0, | |
474 | +}; | |
475 | + | |
446 | 476 | static struct omap_hwmod am33xx_aes0_hwmod = { |
447 | 477 | .name = "aes0", |
448 | 478 | .class = &am33xx_aes_hwmod_class, |
... | ... | @@ -456,6 +486,8 @@ |
456 | 486 | .modulemode = MODULEMODE_SWCTRL, |
457 | 487 | }, |
458 | 488 | }, |
489 | + .slaves = am33xx_aes0_slaves, | |
490 | + .slaves_cnt = ARRAY_SIZE(am33xx_aes0_slaves), | |
459 | 491 | }; |
460 | 492 | |
461 | 493 | /* cefuse */ |