All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: "Krzysztof Kozłowski" <k.kozlowski@samsung.com>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will.deacon@arm.com>,
	devicetree <devicetree@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	"sw0312.kim" <sw0312.kim@samsung.com>,
	"Joonyoung Shim" <jy0922.shim@samsung.com>,
	"InKi Dae" <inki.dae@samsung.com>,
	"Jonghwa Lee" <jonghwa3.lee@samsung.com>,
	"Beomho Seo" <beomho.seo@samsung.com>,
	jaewon02.kim@samsung.com
Subject: Re: [PATCH v2 3/7] pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank
Date: Mon, 05 Sep 2016 17:08:28 +0900	[thread overview]
Message-ID: <57CD27FC.2020201@samsung.com> (raw)
In-Reply-To: <CA+Ln22Guw1LghdV64cSKjByDExr+2HnvEK7DNkYz+XPAmVuAzA@mail.gmail.com>

Hi Tomasz,

I'm sorry for late reply.

On 2016년 08월 25일 23:41, Tomasz Figa wrote:
> 2016-08-25 23:30 GMT+09:00 Tomasz Figa <tomasz.figa@gmail.com>:
>>> +       }
>>> +
>>> +#define EXYNOS_PIN_BANK_EINTN_EXT(pins, reg, id, pctl_idx, eint_idx)   \
>>> +       {                                               \
>>> +               .type           = &bank_type_off,       \
>>> +               .pctl_offset    = reg,                  \
>>> +               .nr_pins        = pins,                 \
>>> +               .eint_type      = EINT_TYPE_NONE,       \
>>> +               .name           = id,                   \
>>> +               .pctl_res_idx   = pctl_idx,             \
>>> +               .eint_res_idx   = eint_dix              \
>>> +       }
>>
>> Your patch 4/7 doesn't seem to use this one, so this is dead code for
>> the time being. Please add when there is real need for it.
>>
>> Also it doesn't really make much sense to have index for both pctl and
>> eint. Please define first entry of regs property as always pointing to
>> pctl registers and by also eint registers for usual controllers. Then
>> second regs entry would be eint registers for controllers with
>> separate register blocks. Then there is only a need to have
>> eint_res_idx in the driver and no need for pctl_res_idx, because it
>> would be always 0.
> 
> Ah, sorry, I got confused again by which registers are where in these
> GPF banks. Let's make it the other way around and make DT contain eint
> registers in first regs entry and hardcode eint_res_idx to 0 for the
> time being.

I got with slight confusion.
Do you mean that you want to remove the 'eint_res_idx' because
it is always zero(0) as your comment. And do you agree to add 'pctl_res_idx'?

Also, as you commented, the eint_res_idx for both GPA and GPFx is zero(0).

Example:
	pinctrl_alive: pinctrl@10580000 {
		compatible = "samsung,exynos5433-pinctrl";
                      /* ALIVE domain    ,  IMEM domain  */
		reg = <0x10580000 0x1a20>, <0x11090000 0x100>;

		wakeup-interrupt-controller {
			compatible = "samsung,exynos7-wakeup-eint";
			interrupts = <GIC_SPI 16 0>;
		};
	};

	GPA's eint_res_idx is 0
	GPA's pctl_res_idx is 0

	GPFx's eint_res_idx is 0
	GPFx's pctl_res_idx is 1


 However it should be still beneficial to refactor the code
> and calculate per-bank eint_base to avoid adding the offset every
> time, similarly to pctl_base/offset, from my suggestion below.

I agree. I'll modify it according to your comment.

> 
>>> @@ -345,7 +346,8 @@ static void pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata,
>>>                         ((b->pin_base + b->nr_pins - 1) < pin))
>>>                 b++;
>>>
>>> -       *reg = drvdata->virt_base + b->pctl_offset;
>>> +       pctl_res_idx = b->pctl_res_idx;
>>> +       *reg = drvdata->virt_base[pctl_res_idx] + b->pctl_offset;
>>
>> I suggested something slightly different. Instead of
>> bank::pctl_res_idx, I proposed bank::pctl_base.
>> bank_info::pctl_res_idx would be specified only in init driver data
>> and bank::pctl_base would be calculated at probe time as
>> drvdata->virt_base[bank_info->pctl_res_idx] + bank_info->pctl_offset.
>> This would eliminate the need to do any indexing and adding further in
>> the code and make things simpler.
>>
>> Taking my other comments above, pctl part would be unchanged and only
>> eint addresses and offsets would be affected.
> 
> Ah, scratch this one sentence. I got confused with the register layout
> again, sorry. Please refactor both eint and pctl as I suggested in the
> upper paragraph.
> 
> Best regards,
> Tomasz
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 

-- 
Best Regards,
Chanwoo Choi

WARNING: multiple messages have this Message-ID (diff)
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: "Krzysztof Kozłowski" <k.kozlowski@samsung.com>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will.deacon@arm.com>,
	devicetree <devicetree@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	"sw0312.kim" <sw0312.kim@samsung.com>,
	"Joonyoung Shim" <jy0922.shim@samsung.com>,
	"InKi Dae" <inki.dae@samsung.com>,
	"Jonghwa Lee" <jonghwa3.lee@samsung.com>,
	"Beomho Seo" <beomho.seo@samsung.com>,
	jaewon02.kim@samsung.com, human.hwang@samsung.com,
	"Inha Song" <ideal.song@samsung.com>,
	ingi2.kim@samsung.com,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Andrzej Hajda" <a.hajda@samsung.com>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	chanwoo@kernel.org, "Linus Walleij" <linus.walleij@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v2 3/7] pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank
Date: Mon, 05 Sep 2016 17:08:28 +0900	[thread overview]
Message-ID: <57CD27FC.2020201@samsung.com> (raw)
In-Reply-To: <CA+Ln22Guw1LghdV64cSKjByDExr+2HnvEK7DNkYz+XPAmVuAzA@mail.gmail.com>

Hi Tomasz,

I'm sorry for late reply.

On 2016년 08월 25일 23:41, Tomasz Figa wrote:
> 2016-08-25 23:30 GMT+09:00 Tomasz Figa <tomasz.figa@gmail.com>:
>>> +       }
>>> +
>>> +#define EXYNOS_PIN_BANK_EINTN_EXT(pins, reg, id, pctl_idx, eint_idx)   \
>>> +       {                                               \
>>> +               .type           = &bank_type_off,       \
>>> +               .pctl_offset    = reg,                  \
>>> +               .nr_pins        = pins,                 \
>>> +               .eint_type      = EINT_TYPE_NONE,       \
>>> +               .name           = id,                   \
>>> +               .pctl_res_idx   = pctl_idx,             \
>>> +               .eint_res_idx   = eint_dix              \
>>> +       }
>>
>> Your patch 4/7 doesn't seem to use this one, so this is dead code for
>> the time being. Please add when there is real need for it.
>>
>> Also it doesn't really make much sense to have index for both pctl and
>> eint. Please define first entry of regs property as always pointing to
>> pctl registers and by also eint registers for usual controllers. Then
>> second regs entry would be eint registers for controllers with
>> separate register blocks. Then there is only a need to have
>> eint_res_idx in the driver and no need for pctl_res_idx, because it
>> would be always 0.
> 
> Ah, sorry, I got confused again by which registers are where in these
> GPF banks. Let's make it the other way around and make DT contain eint
> registers in first regs entry and hardcode eint_res_idx to 0 for the
> time being.

I got with slight confusion.
Do you mean that you want to remove the 'eint_res_idx' because
it is always zero(0) as your comment. And do you agree to add 'pctl_res_idx'?

Also, as you commented, the eint_res_idx for both GPA and GPFx is zero(0).

Example:
	pinctrl_alive: pinctrl@10580000 {
		compatible = "samsung,exynos5433-pinctrl";
                      /* ALIVE domain    ,  IMEM domain  */
		reg = <0x10580000 0x1a20>, <0x11090000 0x100>;

		wakeup-interrupt-controller {
			compatible = "samsung,exynos7-wakeup-eint";
			interrupts = <GIC_SPI 16 0>;
		};
	};

	GPA's eint_res_idx is 0
	GPA's pctl_res_idx is 0

	GPFx's eint_res_idx is 0
	GPFx's pctl_res_idx is 1


 However it should be still beneficial to refactor the code
> and calculate per-bank eint_base to avoid adding the offset every
> time, similarly to pctl_base/offset, from my suggestion below.

I agree. I'll modify it according to your comment.

> 
>>> @@ -345,7 +346,8 @@ static void pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata,
>>>                         ((b->pin_base + b->nr_pins - 1) < pin))
>>>                 b++;
>>>
>>> -       *reg = drvdata->virt_base + b->pctl_offset;
>>> +       pctl_res_idx = b->pctl_res_idx;
>>> +       *reg = drvdata->virt_base[pctl_res_idx] + b->pctl_offset;
>>
>> I suggested something slightly different. Instead of
>> bank::pctl_res_idx, I proposed bank::pctl_base.
>> bank_info::pctl_res_idx would be specified only in init driver data
>> and bank::pctl_base would be calculated at probe time as
>> drvdata->virt_base[bank_info->pctl_res_idx] + bank_info->pctl_offset.
>> This would eliminate the need to do any indexing and adding further in
>> the code and make things simpler.
>>
>> Taking my other comments above, pctl part would be unchanged and only
>> eint addresses and offsets would be affected.
> 
> Ah, scratch this one sentence. I got confused with the register layout
> again, sorry. Please refactor both eint and pctl as I suggested in the
> upper paragraph.
> 
> Best regards,
> Tomasz
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 

-- 
Best Regards,
Chanwoo Choi

WARNING: multiple messages have this Message-ID (diff)
From: cw00.choi@samsung.com (Chanwoo Choi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/7] pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank
Date: Mon, 05 Sep 2016 17:08:28 +0900	[thread overview]
Message-ID: <57CD27FC.2020201@samsung.com> (raw)
In-Reply-To: <CA+Ln22Guw1LghdV64cSKjByDExr+2HnvEK7DNkYz+XPAmVuAzA@mail.gmail.com>

Hi Tomasz,

I'm sorry for late reply.

On 2016? 08? 25? 23:41, Tomasz Figa wrote:
> 2016-08-25 23:30 GMT+09:00 Tomasz Figa <tomasz.figa@gmail.com>:
>>> +       }
>>> +
>>> +#define EXYNOS_PIN_BANK_EINTN_EXT(pins, reg, id, pctl_idx, eint_idx)   \
>>> +       {                                               \
>>> +               .type           = &bank_type_off,       \
>>> +               .pctl_offset    = reg,                  \
>>> +               .nr_pins        = pins,                 \
>>> +               .eint_type      = EINT_TYPE_NONE,       \
>>> +               .name           = id,                   \
>>> +               .pctl_res_idx   = pctl_idx,             \
>>> +               .eint_res_idx   = eint_dix              \
>>> +       }
>>
>> Your patch 4/7 doesn't seem to use this one, so this is dead code for
>> the time being. Please add when there is real need for it.
>>
>> Also it doesn't really make much sense to have index for both pctl and
>> eint. Please define first entry of regs property as always pointing to
>> pctl registers and by also eint registers for usual controllers. Then
>> second regs entry would be eint registers for controllers with
>> separate register blocks. Then there is only a need to have
>> eint_res_idx in the driver and no need for pctl_res_idx, because it
>> would be always 0.
> 
> Ah, sorry, I got confused again by which registers are where in these
> GPF banks. Let's make it the other way around and make DT contain eint
> registers in first regs entry and hardcode eint_res_idx to 0 for the
> time being.

I got with slight confusion.
Do you mean that you want to remove the 'eint_res_idx' because
it is always zero(0) as your comment. And do you agree to add 'pctl_res_idx'?

Also, as you commented, the eint_res_idx for both GPA and GPFx is zero(0).

Example:
	pinctrl_alive: pinctrl at 10580000 {
		compatible = "samsung,exynos5433-pinctrl";
                      /* ALIVE domain    ,  IMEM domain  */
		reg = <0x10580000 0x1a20>, <0x11090000 0x100>;

		wakeup-interrupt-controller {
			compatible = "samsung,exynos7-wakeup-eint";
			interrupts = <GIC_SPI 16 0>;
		};
	};

	GPA's eint_res_idx is 0
	GPA's pctl_res_idx is 0

	GPFx's eint_res_idx is 0
	GPFx's pctl_res_idx is 1


 However it should be still beneficial to refactor the code
> and calculate per-bank eint_base to avoid adding the offset every
> time, similarly to pctl_base/offset, from my suggestion below.

I agree. I'll modify it according to your comment.

> 
>>> @@ -345,7 +346,8 @@ static void pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata,
>>>                         ((b->pin_base + b->nr_pins - 1) < pin))
>>>                 b++;
>>>
>>> -       *reg = drvdata->virt_base + b->pctl_offset;
>>> +       pctl_res_idx = b->pctl_res_idx;
>>> +       *reg = drvdata->virt_base[pctl_res_idx] + b->pctl_offset;
>>
>> I suggested something slightly different. Instead of
>> bank::pctl_res_idx, I proposed bank::pctl_base.
>> bank_info::pctl_res_idx would be specified only in init driver data
>> and bank::pctl_base would be calculated at probe time as
>> drvdata->virt_base[bank_info->pctl_res_idx] + bank_info->pctl_offset.
>> This would eliminate the need to do any indexing and adding further in
>> the code and make things simpler.
>>
>> Taking my other comments above, pctl part would be unchanged and only
>> eint addresses and offsets would be affected.
> 
> Ah, scratch this one sentence. I got confused with the register layout
> again, sorry. Please refactor both eint and pctl as I suggested in the
> upper paragraph.
> 
> Best regards,
> Tomasz
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 

-- 
Best Regards,
Chanwoo Choi

  reply	other threads:[~2016-09-05  8:08 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 13:49 [PATCH v2 0/7] arm64: dts: Add the dts file for Exynos5433 and TM/TM2E board Chanwoo Choi
2016-08-24 13:49 ` Chanwoo Choi
2016-08-24 13:49 ` Chanwoo Choi
2016-08-24 13:49 ` [PATCH v2 1/7] clocksource: exynos_mct: Add the support for ARM64 Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-26 16:02   ` Krzysztof Kozlowski
2016-08-26 16:02     ` Krzysztof Kozlowski
2016-09-08 11:04   ` Daniel Lezcano
2016-09-08 11:04     ` Daniel Lezcano
     [not found]     ` <CGME20160916111052eucas1p1fb19531ab7b3e53f6fdeb4fa0e8a5449@eucas1p1.samsung.com>
2016-09-16 11:10       ` Krzysztof Kozlowski
2016-09-16 11:10         ` Krzysztof Kozlowski
2016-08-24 13:49 ` [PATCH v2 2/7] Documentation: bindings: Add Exynos5433 PMU compatible Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-24 13:49 ` [PATCH v2 3/7] pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-25 14:30   ` Tomasz Figa
2016-08-25 14:30     ` Tomasz Figa
2016-08-25 14:30     ` Tomasz Figa
2016-08-25 14:41     ` Tomasz Figa
2016-08-25 14:41       ` Tomasz Figa
2016-08-25 14:41       ` Tomasz Figa
2016-09-05  8:08       ` Chanwoo Choi [this message]
2016-09-05  8:08         ` Chanwoo Choi
2016-09-05  8:08         ` Chanwoo Choi
     [not found]         ` <57CD27FC.2020201-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-09-20  1:03           ` Tomasz Figa
2016-09-20  1:03             ` Tomasz Figa
2016-09-20  1:03             ` Tomasz Figa
2016-08-24 13:49 ` [PATCH v2 4/7] pinctrl: samsung: Add GPF support for Exynos5433 Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-25 14:34   ` Tomasz Figa
2016-08-25 14:34     ` Tomasz Figa
2016-08-25 14:34     ` Tomasz Figa
2016-08-24 13:49 ` [PATCH v2 5/7] arm64: dts: exynos: Add dts files for Samsung Exynos5433 64bit SoC Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-26 16:14   ` Krzysztof Kozlowski
2016-08-26 16:14     ` Krzysztof Kozlowski
2016-09-02  9:54     ` Chanwoo Choi
2016-09-02  9:54       ` Chanwoo Choi
2016-08-26 17:49   ` Javier Martinez Canillas
2016-08-26 17:49     ` Javier Martinez Canillas
2016-08-26 17:49     ` Javier Martinez Canillas
2016-09-02 10:59     ` Chanwoo Choi
2016-09-02 10:59       ` Chanwoo Choi
2016-09-07  7:55       ` Javier Martinez Canillas
2016-09-07  7:55         ` Javier Martinez Canillas
2016-10-04 13:37   ` Geert Uytterhoeven
2016-10-04 13:37     ` Geert Uytterhoeven
2016-10-04 13:37     ` Geert Uytterhoeven
2016-10-04 13:46     ` Krzysztof Kozlowski
2016-10-04 13:46       ` Krzysztof Kozlowski
2016-10-04 13:46       ` Krzysztof Kozlowski
2016-08-24 13:49 ` [PATCH v2 6/7] arm64: dts: exynos: Add dts file for Exynos5433-based TM2 board Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-25  9:28   ` kbuild test robot
2016-08-25  9:28     ` kbuild test robot
2016-08-25  9:28     ` kbuild test robot
2016-08-26 16:32   ` Krzysztof Kozlowski
2016-08-26 16:32     ` Krzysztof Kozlowski
2016-08-26 16:32     ` Krzysztof Kozlowski
2016-08-26 17:11     ` Krzysztof Kozlowski
2016-08-26 17:11       ` Krzysztof Kozlowski
2016-08-26 17:11       ` Krzysztof Kozlowski
2016-08-26 20:46     ` Chanwoo Choi
2016-08-26 20:46       ` Chanwoo Choi
2016-08-26 20:46       ` Chanwoo Choi
2016-08-26 18:30   ` Javier Martinez Canillas
2016-08-26 18:30     ` Javier Martinez Canillas
2016-08-26 18:30     ` Javier Martinez Canillas
2016-08-26 18:35     ` Javier Martinez Canillas
2016-08-26 18:35       ` Javier Martinez Canillas
2016-09-02 11:29     ` Chanwoo Choi
2016-09-02 11:29       ` Chanwoo Choi
2016-09-07  8:08       ` Javier Martinez Canillas
2016-09-07  8:08         ` Javier Martinez Canillas
2016-08-30 17:11   ` Rob Herring
2016-08-30 17:11     ` Rob Herring
2016-08-30 17:11     ` Rob Herring
2016-08-31  1:24     ` Chanwoo Choi
2016-08-31  1:24       ` Chanwoo Choi
2016-08-31  1:24       ` Chanwoo Choi
2016-08-24 13:49 ` [PATCH v2 7/7] arm64: dts: exynos: Add dts file for Exynos5433-based TM2E board Chanwoo Choi
2016-08-24 13:49   ` Chanwoo Choi
2016-08-26 18:32   ` Javier Martinez Canillas
2016-08-26 18:32     ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57CD27FC.2020201@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=beomho.seo@samsung.com \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=inki.dae@samsung.com \
    --cc=jaewon02.kim@samsung.com \
    --cc=jh80.chung@samsung.com \
    --cc=jonghwa3.lee@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=tomasz.figa@gmail.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.