RE: [PATCH v9 1/2] ARM: EXYNOS: Change System MMU platform device definitions
Hello, On Wednesday, February 29, 2012 1:26 AM KyongHo Cho wrote: > On Tue, Feb 28, 2012 at 4:20 PM, Kyungmin Park > wrote: > > Hi, > > > > On 2/28/12, KyongHo Cho wrote: > >> Handling System MMUs with an identifier is not flexible to manage > >> System MMU platform devices because of the following reasons: > >> 1. A device driver which needs to handle System MMU must know the ID. > >> 2. A System MMU may not present in some implementations of Exynos family. > >> 3. Handling System MMU with IOMMU API does not require an ID. > >> > >> This patch is the result of removing ID of System MMUs. > >> Instead, a device driver that needs to handle its System MMU must > >> use IOMMU API while its descriptor of platform device is given. > >> > >> This patch also includes the following enhancements: > >> - A System MMU device becomes a child if its power domain device. > >> - clkdev > >> > >> Signed-off-by: KyongHo Cho > >> --- > >> arch/arm/mach-exynos/Kconfig | 11 +- > >> arch/arm/mach-exynos/Makefile | 2 +- > >> arch/arm/mach-exynos/clock-exynos4.c | 79 ++-- > >> arch/arm/mach-exynos/clock-exynos4.h | 2 + > >> arch/arm/mach-exynos/clock-exynos4210.c | 11 + > >> arch/arm/mach-exynos/clock-exynos4212.c | 28 ++- > >> arch/arm/mach-exynos/clock-exynos5.c | 90 + > >> arch/arm/mach-exynos/dev-sysmmu.c | 451 > >> --- > >> arch/arm/mach-exynos/include/mach/irqs.h | 179 +- > >> arch/arm/mach-exynos/include/mach/map.h | 38 ++ > >> arch/arm/mach-exynos/include/mach/regs-clock.h | 5 + > >> arch/arm/mach-exynos/include/mach/regs-sysmmu.h | 28 -- > >> arch/arm/mach-exynos/include/mach/sysmmu.h | 84 +++-- > >> arch/arm/mach-exynos/mach-armlex4210.c | 1 - > >> arch/arm/mach-exynos/mach-smdkv310.c | 1 - > >> arch/arm/plat-s5p/sysmmu.c | 13 +- > >> arch/arm/plat-samsung/include/plat/devs.h | 1 - > >> 17 files changed, 618 insertions(+), 406 deletions(-) > > It's too big to cover these changes. Can you make it more small changes. > > 1. Remove existing ones since no user at this time. > > 2. Add new define and data structures. > > 3. Support new system mmu features based on generic iommu. > > > > Your suggestion sounds good. Thank you. > > >> static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable) > >> { > >> return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable); > >> @@ -679,61 +684,55 @@ static struct clk exynos4_init_clocks_off[] = { > >> .enable = exynos4_clk_ip_peril_ctrl, > >> .ctrlbit = (1 << 14), > >> }, { > >> - .name = "SYSMMU_MDMA", > >> + .name = SYSMMU_CLOCK_NAME, > >> + .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0), > >> + .enable = exynos4_clk_ip_mfc_ctrl, > >> + .ctrlbit = (1 << 1), > >> + }, { > >> + .name = SYSMMU_CLOCK_NAME, > >> + .devname = SYSMMU_CLOCK_DEVNAME(mfc_r, 1), > >> + .enable = exynos4_clk_ip_mfc_ctrl, > >> + .ctrlbit = (1 << 2), > >> + }, { > >> + .name = SYSMMU_CLOCK_NAME, > >> + .devname = SYSMMU_CLOCK_DEVNAME(tv, 2), > >> + .enable = exynos4_clk_ip_tv_ctrl, > >> + .ctrlbit = (1 << 4), > >> + }, { > >> + .name = SYSMMU_CLOCK_NAME, > >> + .devname = SYSMMU_CLOCK_DEVNAME(jpeg, 3), > >> + .enable = exynos4_clk_ip_cam_ctrl, > >> + .ctrlbit = (1 << 11), > >> + }, { > >> + .name = SYSMMU_CLOCK_NAME, > >> + .devname = SYSMMU_CLOCK_DEVNAME(rot, 4), > >> .enable = exynos4_clk_ip_image_ctrl, > >> - .ctrlbit = (1 << 5), > >> + .ctrlbit = (1 << 4), > >> }, { > >> - .name = "SYSMMU_FIMC0", > >> + .name = SYSMMU_CLOCK_NAME, > >> + .devname = SYSMMU_CLOCK_DEVNAME(gsc0, 5), > > It's exynos4 series clock and don't have gsc name. I don't know LSI > > decides to use gsc instead of fimc for both exynos4 and exynos5. but > > there's no name gsc at Spec.. > > gsc0 is just a name of the platform device of FIMC0 in Exynos4. > It is also used for GSclaler0 in Exynos5. > I wanted to reduce waste of platform device definitions that do not exist > in an application processor. > > If it looks confused, I will find another way. > >> +#define SYSMMU_RESOURCE_NAME(core, ipname) sysmmures_##core##_##ipname > >> + > >> +#define SYSMMU_RESOURCE(core, ipname) > >> \ > >> + static struct resource SYSMMU_RESOURCE_NAME(core, ipname)[] > >> __initdata =
Re: [PATCH v9 1/2] ARM: EXYNOS: Change System MMU platform device definitions
Hello, On 02/29/2012 01:25 AM, KyongHo Cho wrote: >>> static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable) >>> { >>> return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable); >>> @@ -679,61 +684,55 @@ static struct clk exynos4_init_clocks_off[] = { >>> .enable = exynos4_clk_ip_peril_ctrl, >>> .ctrlbit= (1 << 14), >>> }, { >>> - .name = "SYSMMU_MDMA", >>> + .name = SYSMMU_CLOCK_NAME, >>> + .devname= SYSMMU_CLOCK_DEVNAME(mfc_l, 0), >>> + .enable = exynos4_clk_ip_mfc_ctrl, >>> + .ctrlbit= (1 << 1), >>> + }, { >>> + .name = SYSMMU_CLOCK_NAME, >>> + .devname= SYSMMU_CLOCK_DEVNAME(mfc_r, 1), >>> + .enable = exynos4_clk_ip_mfc_ctrl, >>> + .ctrlbit= (1 << 2), >>> + }, { >>> + .name = SYSMMU_CLOCK_NAME, >>> + .devname= SYSMMU_CLOCK_DEVNAME(tv, 2), >>> + .enable = exynos4_clk_ip_tv_ctrl, >>> + .ctrlbit= (1 << 4), >>> + }, { >>> + .name = SYSMMU_CLOCK_NAME, >>> + .devname= SYSMMU_CLOCK_DEVNAME(jpeg, 3), >>> + .enable = exynos4_clk_ip_cam_ctrl, >>> + .ctrlbit= (1 << 11), >>> + }, { >>> + .name = SYSMMU_CLOCK_NAME, >>> + .devname= SYSMMU_CLOCK_DEVNAME(rot, 4), >>> .enable = exynos4_clk_ip_image_ctrl, >>> - .ctrlbit= (1 << 5), >>> + .ctrlbit= (1 << 4), >>> }, { >>> - .name = "SYSMMU_FIMC0", >>> + .name = SYSMMU_CLOCK_NAME, >>> + .devname= SYSMMU_CLOCK_DEVNAME(gsc0, 5), >> It's exynos4 series clock and don't have gsc name. I don't know LSI >> decides to use gsc instead of fimc for both exynos4 and exynos5. but >> there's no name gsc at Spec.. > > gsc0 is just a name of the platform device of FIMC0 in Exynos4. I think it's not right what you're saying. Gscalers first appeared only in exynos5 (at least according to all specifications I have) and you already have the corresponding change for clock-exynos5.c. FIMCs in exynos 4210, 4212 and 4412 are almost not changed, so please don't rename like this, which is confusing. If you need common clkdev entries for the exynos4 and exynos5 devices, then the "devname"s above might need to be removed and required clock entries should be created through the CLKDEV_INIT() macro. > It is also used for GSclaler0 in Exynos5. > I wanted to reduce waste of platform device definitions that do not exist > in an application processor. > > If it looks confused, I will find another way. Thanks, -- Sylwester Nawrocki Samsung Poland R&D Center -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v9 1/2] ARM: EXYNOS: Change System MMU platform device definitions
On Tue, Feb 28, 2012 at 4:20 PM, Kyungmin Park wrote: > Hi, > > On 2/28/12, KyongHo Cho wrote: >> Handling System MMUs with an identifier is not flexible to manage >> System MMU platform devices because of the following reasons: >> 1. A device driver which needs to handle System MMU must know the ID. >> 2. A System MMU may not present in some implementations of Exynos family. >> 3. Handling System MMU with IOMMU API does not require an ID. >> >> This patch is the result of removing ID of System MMUs. >> Instead, a device driver that needs to handle its System MMU must >> use IOMMU API while its descriptor of platform device is given. >> >> This patch also includes the following enhancements: >> - A System MMU device becomes a child if its power domain device. >> - clkdev >> >> Signed-off-by: KyongHo Cho >> --- >> arch/arm/mach-exynos/Kconfig | 11 +- >> arch/arm/mach-exynos/Makefile | 2 +- >> arch/arm/mach-exynos/clock-exynos4.c | 79 ++-- >> arch/arm/mach-exynos/clock-exynos4.h | 2 + >> arch/arm/mach-exynos/clock-exynos4210.c | 11 + >> arch/arm/mach-exynos/clock-exynos4212.c | 28 ++- >> arch/arm/mach-exynos/clock-exynos5.c | 90 + >> arch/arm/mach-exynos/dev-sysmmu.c | 451 >> --- >> arch/arm/mach-exynos/include/mach/irqs.h | 179 +- >> arch/arm/mach-exynos/include/mach/map.h | 38 ++ >> arch/arm/mach-exynos/include/mach/regs-clock.h | 5 + >> arch/arm/mach-exynos/include/mach/regs-sysmmu.h | 28 -- >> arch/arm/mach-exynos/include/mach/sysmmu.h | 84 +++-- >> arch/arm/mach-exynos/mach-armlex4210.c | 1 - >> arch/arm/mach-exynos/mach-smdkv310.c | 1 - >> arch/arm/plat-s5p/sysmmu.c | 13 +- >> arch/arm/plat-samsung/include/plat/devs.h | 1 - >> 17 files changed, 618 insertions(+), 406 deletions(-) > It's too big to cover these changes. Can you make it more small changes. > 1. Remove existing ones since no user at this time. > 2. Add new define and data structures. > 3. Support new system mmu features based on generic iommu. > Your suggestion sounds good. Thank you. >> static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable) >> { >> return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable); >> @@ -679,61 +684,55 @@ static struct clk exynos4_init_clocks_off[] = { >> .enable = exynos4_clk_ip_peril_ctrl, >> .ctrlbit = (1 << 14), >> }, { >> - .name = "SYSMMU_MDMA", >> + .name = SYSMMU_CLOCK_NAME, >> + .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0), >> + .enable = exynos4_clk_ip_mfc_ctrl, >> + .ctrlbit = (1 << 1), >> + }, { >> + .name = SYSMMU_CLOCK_NAME, >> + .devname = SYSMMU_CLOCK_DEVNAME(mfc_r, 1), >> + .enable = exynos4_clk_ip_mfc_ctrl, >> + .ctrlbit = (1 << 2), >> + }, { >> + .name = SYSMMU_CLOCK_NAME, >> + .devname = SYSMMU_CLOCK_DEVNAME(tv, 2), >> + .enable = exynos4_clk_ip_tv_ctrl, >> + .ctrlbit = (1 << 4), >> + }, { >> + .name = SYSMMU_CLOCK_NAME, >> + .devname = SYSMMU_CLOCK_DEVNAME(jpeg, 3), >> + .enable = exynos4_clk_ip_cam_ctrl, >> + .ctrlbit = (1 << 11), >> + }, { >> + .name = SYSMMU_CLOCK_NAME, >> + .devname = SYSMMU_CLOCK_DEVNAME(rot, 4), >> .enable = exynos4_clk_ip_image_ctrl, >> - .ctrlbit = (1 << 5), >> + .ctrlbit = (1 << 4), >> }, { >> - .name = "SYSMMU_FIMC0", >> + .name = SYSMMU_CLOCK_NAME, >> + .devname = SYSMMU_CLOCK_DEVNAME(gsc0, 5), > It's exynos4 series clock and don't have gsc name. I don't know LSI > decides to use gsc instead of fimc for both exynos4 and exynos5. but > there's no name gsc at Spec.. gsc0 is just a name of the platform device of FIMC0 in Exynos4. It is also used for GSclaler0 in Exynos5. I wanted to reduce waste of platform device definitions that do not exist in an application processor. If it looks confused, I will find another way. >> +#define SYSMMU_RESOURCE_NAME(core, ipname) sysmmures_##core##_##ipname >> + >> +#define SYSMMU_RESOURCE(core, ipname) >> \ >> + static struct resource SYSMMU_RESOURCE_NAME(core, ipname)[] __initdata >> = >> + >> +#define DEFINE_SYSMMU_RESOURCE(core, mem, irq) >> \ >> + DEFINE_RES_MEM_NAMED(core##_PA_SYSMMU_##mem, SZ_4K, #mem), \ >> + DEFINE_RES_IRQ_NAMED(core##_IRQ_SYSMMU_##irq##_0, #mem) >> + >> +#define SYSMMU_RESOURCE_DEFINE
Re: [PATCH v9 1/2] ARM: EXYNOS: Change System MMU platform device definitions
Hi, On 2/28/12, KyongHo Cho wrote: > Handling System MMUs with an identifier is not flexible to manage > System MMU platform devices because of the following reasons: > 1. A device driver which needs to handle System MMU must know the ID. > 2. A System MMU may not present in some implementations of Exynos family. > 3. Handling System MMU with IOMMU API does not require an ID. > > This patch is the result of removing ID of System MMUs. > Instead, a device driver that needs to handle its System MMU must > use IOMMU API while its descriptor of platform device is given. > > This patch also includes the following enhancements: > - A System MMU device becomes a child if its power domain device. > - clkdev > > Signed-off-by: KyongHo Cho > --- > arch/arm/mach-exynos/Kconfig| 11 +- > arch/arm/mach-exynos/Makefile |2 +- > arch/arm/mach-exynos/clock-exynos4.c| 79 ++-- > arch/arm/mach-exynos/clock-exynos4.h|2 + > arch/arm/mach-exynos/clock-exynos4210.c | 11 + > arch/arm/mach-exynos/clock-exynos4212.c | 28 ++- > arch/arm/mach-exynos/clock-exynos5.c| 90 + > arch/arm/mach-exynos/dev-sysmmu.c | 451 > --- > arch/arm/mach-exynos/include/mach/irqs.h| 179 +- > arch/arm/mach-exynos/include/mach/map.h | 38 ++ > arch/arm/mach-exynos/include/mach/regs-clock.h |5 + > arch/arm/mach-exynos/include/mach/regs-sysmmu.h | 28 -- > arch/arm/mach-exynos/include/mach/sysmmu.h | 84 +++-- > arch/arm/mach-exynos/mach-armlex4210.c |1 - > arch/arm/mach-exynos/mach-smdkv310.c|1 - > arch/arm/plat-s5p/sysmmu.c | 13 +- > arch/arm/plat-samsung/include/plat/devs.h |1 - > 17 files changed, 618 insertions(+), 406 deletions(-) It's too big to cover these changes. Can you make it more small changes. 1. Remove existing ones since no user at this time. 2. Add new define and data structures. 3. Support new system mmu features based on generic iommu. > delete mode 100644 arch/arm/mach-exynos/include/mach/regs-sysmmu.h > > diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig > index 40ad6b4..f7eabaf 100644 > --- a/arch/arm/mach-exynos/Kconfig > +++ b/arch/arm/mach-exynos/Kconfig > @@ -95,10 +95,10 @@ config EXYNOS4_DEV_PD > help > Compile in platform device definitions for Power Domain > > -config EXYNOS4_DEV_SYSMMU > +config EXYNOS_DEV_SYSMMU It's simple example. The renaming is one candidate patch. > bool > help > - Common setup code for SYSTEM MMU in EXYNOS4 > + Common setup code for SYSTEM MMU in EXYNOS platforms > > config EXYNOS4_DEV_DWMCI > bool > @@ -212,9 +212,9 @@ config MACH_SMDKV310 > select SAMSUNG_DEV_KEYPAD > select SAMSUNG_DEV_PWM > select EXYNOS_DEV_DMA > + select EXYNOS_DEV_SYSMMU > select EXYNOS4_DEV_PD > select EXYNOS4_DEV_USB_OHCI > - select EXYNOS4_DEV_SYSMMU > select EXYNOS4_SETUP_FIMD0 > select EXYNOS4_SETUP_I2C1 > select EXYNOS4_SETUP_KEYPAD > @@ -233,7 +233,6 @@ config MACH_ARMLEX4210 > select S3C_DEV_HSMMC3 > select EXYNOS_DEV_DMA > select EXYNOS4_DEV_AHCI > - select EXYNOS4_DEV_SYSMMU > select EXYNOS4_SETUP_SDHCI > help > Machine support for Samsung ARMLEX4210 based on EXYNOS4210 > @@ -259,6 +258,7 @@ config MACH_UNIVERSAL_C210 > select S5P_DEV_ONENAND > select S5P_DEV_TV > select EXYNOS_DEV_DMA > + select EXYNOS_DEV_SYSMMU > select EXYNOS4_DEV_PD > select EXYNOS4_SETUP_FIMD0 > select EXYNOS4_SETUP_I2C1 > @@ -326,6 +326,7 @@ config MACH_ORIGEN > select SAMSUNG_DEV_BACKLIGHT > select SAMSUNG_DEV_PWM > select EXYNOS_DEV_DMA > + select EXYNOS_DEV_SYSMMU > select EXYNOS4_DEV_PD > select EXYNOS4_DEV_USB_OHCI > select EXYNOS4_SETUP_FIMD0 > @@ -350,6 +351,7 @@ config MACH_SMDK4212 > select SAMSUNG_DEV_KEYPAD > select SAMSUNG_DEV_PWM > select EXYNOS_DEV_DMA > + select EXYNOS_DEV_SYSMMU > select EXYNOS4_SETUP_I2C1 > select EXYNOS4_SETUP_I2C3 > select EXYNOS4_SETUP_I2C7 > @@ -376,6 +378,7 @@ config MACH_SMDK5250 > bool "SMDK5250" > select SOC_EXYNOS5250 > select EXYNOS_DEV_DMA > + select EXYNOS_DEV_SYSMMU > help > Machine support for Samsung SMDK5250 > endif > diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile > index 08b4eb1..aac02a8 100644 > --- a/arch/arm/mach-exynos/Makefile > +++ b/arch/arm/mach-exynos/Makefile > @@ -52,7 +52,7 @@ obj-y += dev-uart.o > obj-$(CONFIG_ARCH_EXYNOS4) += dev-audio.o > obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o > obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o > -obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o > +obj-$(CONFIG_EXYNOS_D