From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mpc85xx: Fix the offset of register address error
Date: Tue, 8 Oct 2013 09:46:41 -0700 [thread overview]
Message-ID: <525436F1.9060903@freescale.com> (raw)
In-Reply-To: <D07C73A334FF604B95B3CBD2A545D07B150A5139@039-SN2MPN1-013.039d.mgd.msft.net>
On 10/07/2013 08:28 PM, Tang Yuantian-B29983 wrote:
>>> diff --git a/arch/powerpc/include/asm/mpc85xx_gpio.h
>>> b/arch/powerpc/include/asm/mpc85xx_gpio.h
>>> index 3d11884..87bb4a0 100644
>>> --- a/arch/powerpc/include/asm/mpc85xx_gpio.h
>>> +++ b/arch/powerpc/include/asm/mpc85xx_gpio.h
>>> @@ -20,7 +20,7 @@
>>> static inline void mpc85xx_gpio_set(unsigned int mask,
>>> unsigned int dir, unsigned int val) {
>>> - ccsr_gpio_t *gpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR + 0xc00);
>>> + ccsr_gpio_t *gpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
>>>
>>> /* First mask off the unwanted parts of "dir" and "val" */
>>> dir &= mask;
>>> @@ -56,7 +56,7 @@ static inline void mpc85xx_gpio_set_high(unsigned
>>> int gpios)
>>>
>>> static inline unsigned int mpc85xx_gpio_get(unsigned int mask) {
>>> - ccsr_gpio_t *gpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR + 0xc00);
>>> + ccsr_gpio_t *gpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
>>>
>>> /* Read the requested values */
>>> return in_be32(&gpio->gpdat) & mask;
>>>
>>
>> Yuantian,
>>
>> Please go through the base address again. I think some SoCs do use 0xc00
>> offset from 0xF000, for eample P1020, P1023, MPC8572. I only spot checked
>> several.
>>
>
> Hi York,
> I double checked the offset address of GPIO, I found that the offset addresses of
> GPIO on the boards you mentioned above are all changed to 0x0, not 0xc00 according
> to the newest RM.
> I do found that the offset address is 0xc00 in some old RMs.
> You can find the newest RM here:
> For MPC8572: http://compass.freescale.net/livelink/livelink/fetch/2001/3448/223475/200815/108253488/223469393/223503931/226628079/226445024/MPC8572ERM_Rev3_DRAFT1.pdf?nodeid=226438746&vernum=-2
> For p1023:
> http://compass.freescale.net/livelink/livelink/fetch/2001/3448/223475/200815/108253488/223469393/223506436/223521755/223743960/P1023RM_Mark-up.pdf?nodeid=229647544&vernum=-2
> for 1020:
> http://compass.freescale.net/livelink/livelink/fetch/2001/3448/223475/200815/108253488/223469393/223506436/223522385/224515312/P1020RM_Rev6_Mark-up.pdf?nodeid=228476444&vernum=-2
>
> If the offset addresses on these boards were 0xc00, the driver is still wrong, because in that case
> The GPIO address should be: CONFIG_SYS_IMMR + 0xc00, not CONFIG_SYS_MPC85xx_GPIO_ADDR + 0xc00.
> (CONFIG_SYS_MPC85xx_GPIO_ADDR == CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_GPIO_OFFSET).
>
> So, please apply this patch, I need the GPIO driver to operate GPIO.
>
Looks you are correct. I find the changed offset on some published
documents as well (please use public link for discussion in the future).
York
next prev parent reply other threads:[~2013-10-08 16:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 9:33 [U-Boot] [PATCH] mpc85xx: Fix the offset of register address error Tang Yuantian
2013-10-01 15:42 ` York Sun
2013-10-08 3:28 ` Tang Yuantian-B29983
2013-10-08 16:46 ` York Sun [this message]
2013-10-08 16:52 ` York Sun
2013-10-09 1:39 ` Tang Yuantian-B29983
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=525436F1.9060903@freescale.com \
--to=yorksun@freescale.com \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox