* [U-Boot] [PATCH v2 0/2] i2c: sh_i2c: bugfix: i2c probe command does not work @ 2014-04-14 4:45 Tetsuyuki Kobayashi 2014-04-14 4:45 ` [U-Boot] [PATCH v2 1/2] " Tetsuyuki Kobayashi ` (2 more replies) 0 siblings, 3 replies; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-14 4:45 UTC (permalink / raw) To: u-boot Hello, I found i2c probe command bug on kzm9g board and fixed it. The v1 patches are faild to post because I was not subscribing u-boot ML. Changes for v2: - correct typo in commit message. Tetsuyuki Kobayashi (2): i2c: sh_i2c: bugfix: i2c probe command does now work arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD drivers/i2c/sh_i2c.c | 2 +- include/configs/kzm9g.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 1.7.9.5 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v2 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 4:45 [U-Boot] [PATCH v2 0/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi @ 2014-04-14 4:45 ` Tetsuyuki Kobayashi 2014-04-14 5:22 ` Heiko Schocher 2014-04-14 4:45 ` [U-Boot] [PATCH v2 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 2014-04-14 8:13 ` [U-Boot] [PATCH v3 0/2] kzm9g i2c bugfix and CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 2 siblings, 1 reply; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-14 4:45 UTC (permalink / raw) To: u-boot This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework Before commit 2035d77d, i2c probe command works properly on kzm9g board. KZM-A9-GT# i2c probe Valid chip addresses: 0C 12 1D 32 39 3D 40 60 After commit 2035d77d, i2c probe command does not work. KZM-A9-GT# i2c probe Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch changes read length to 1. Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> --- drivers/i2c/sh_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c index cc19100..264c2e6 100644 --- a/drivers/i2c/sh_i2c.c +++ b/drivers/i2c/sh_i2c.c @@ -269,7 +269,7 @@ static int sh_i2c_write(struct i2c_adapter *adap, uint8_t chip, uint addr, static int sh_i2c_probe(struct i2c_adapter *adap, u8 dev) { - return sh_i2c_read(adap, dev, 0, 0, NULL, 0); + return sh_i2c_read(adap, dev, 0, 0, NULL, 1); } static unsigned int sh_i2c_set_bus_speed(struct i2c_adapter *adap, -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v2 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 4:45 ` [U-Boot] [PATCH v2 1/2] " Tetsuyuki Kobayashi @ 2014-04-14 5:22 ` Heiko Schocher 2014-04-14 6:09 ` Nobuhiro Iwamatsu 0 siblings, 1 reply; 16+ messages in thread From: Heiko Schocher @ 2014-04-14 5:22 UTC (permalink / raw) To: u-boot Hello Tetsuyuki Am 14.04.2014 06:45, schrieb Tetsuyuki Kobayashi: > This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework > > Before commit 2035d77d, i2c probe command works properly on kzm9g board. > > KZM-A9-GT# i2c probe > Valid chip addresses: 0C 12 1D 32 39 3D 40 60 > > After commit 2035d77d, i2c probe command does not work. > > KZM-A9-GT# i2c probe > Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F > > sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch changes read length to 1. > > Signed-off-by: Tetsuyuki Kobayashi<koba@kmckk.co.jp> > --- > drivers/i2c/sh_i2c.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) I could not find your patch in patchwork ... so I think it go through u-boot-sh.git, so: Acked-by: Heiko Schocher <hs@denx.de> Thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v2 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 5:22 ` Heiko Schocher @ 2014-04-14 6:09 ` Nobuhiro Iwamatsu 2014-04-14 6:49 ` Tetsuyuki Kobayashi 0 siblings, 1 reply; 16+ messages in thread From: Nobuhiro Iwamatsu @ 2014-04-14 6:09 UTC (permalink / raw) To: u-boot Hi, 2014-04-14 14:22 GMT+09:00 Heiko Schocher <hs@denx.de>: > Hello Tetsuyuki > > Am 14.04.2014 06:45, schrieb Tetsuyuki Kobayashi: > >> This is regression of commit 2035d77d i2c: sh_i2c: Update to new >> CONFIG_SYS_I2C framework >> >> Before commit 2035d77d, i2c probe command works properly on kzm9g board. >> >> KZM-A9-GT# i2c probe >> Valid chip addresses: 0C 12 1D 32 39 3D 40 60 >> >> After commit 2035d77d, i2c probe command does not work. >> >> KZM-A9-GT# i2c probe >> Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 >> 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 >> 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 >> 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B >> 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 >> 75 76 77 78 79 7A 7B 7C 7D 7E 7F >> >> sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it >> does not read device at all. This patch changes read length to 1. >> >> Signed-off-by: Tetsuyuki Kobayashi<koba@kmckk.co.jp> >> --- >> drivers/i2c/sh_i2c.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > > I could not find your patch in patchwork ... so I think > it go through u-boot-sh.git, so: > > Acked-by: Heiko Schocher <hs@denx.de> > Thanks! I think the reason that is not registered in the patchwork, the subject is because he is 0/2. Tetsuyuki, could you re-send this patch? > Thanks! > > bye, > Heiko > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Best regards, Nobuhiro -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v2 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 6:09 ` Nobuhiro Iwamatsu @ 2014-04-14 6:49 ` Tetsuyuki Kobayashi 0 siblings, 0 replies; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-14 6:49 UTC (permalink / raw) To: u-boot Hello, Nobihiro, Heiko I found bug in this patch. When I change read length 0 to 1, I have to change buffer address NULL to some valid memory address. I am going to v3 patch as soon as possible. (2014/04/14 15:09), Nobuhiro Iwamatsu wrote: > Hi, > > 2014-04-14 14:22 GMT+09:00 Heiko Schocher <hs@denx.de>: >> Hello Tetsuyuki >> >> Am 14.04.2014 06:45, schrieb Tetsuyuki Kobayashi: >> >>> This is regression of commit 2035d77d i2c: sh_i2c: Update to new >>> CONFIG_SYS_I2C framework >>> >>> Before commit 2035d77d, i2c probe command works properly on kzm9g board. >>> >>> KZM-A9-GT# i2c probe >>> Valid chip addresses: 0C 12 1D 32 39 3D 40 60 >>> >>> After commit 2035d77d, i2c probe command does not work. >>> >>> KZM-A9-GT# i2c probe >>> Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 >>> 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 >>> 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 >>> 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B >>> 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 >>> 75 76 77 78 79 7A 7B 7C 7D 7E 7F >>> >>> sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it >>> does not read device at all. This patch changes read length to 1. >>> >>> Signed-off-by: Tetsuyuki Kobayashi<koba@kmckk.co.jp> >>> --- >>> drivers/i2c/sh_i2c.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> >> I could not find your patch in patchwork ... so I think >> it go through u-boot-sh.git, so: >> >> Acked-by: Heiko Schocher <hs@denx.de> >> > > Thanks! > I think the reason that is not registered in the patchwork, the > subject is because he is 0/2. > Tetsuyuki, could you re-send this patch? > >> Thanks! >> >> bye, >> Heiko >> -- >> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel >> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > > Best regards, > Nobuhiro > ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v2 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD 2014-04-14 4:45 [U-Boot] [PATCH v2 0/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi 2014-04-14 4:45 ` [U-Boot] [PATCH v2 1/2] " Tetsuyuki Kobayashi @ 2014-04-14 4:45 ` Tetsuyuki Kobayashi 2014-04-14 5:24 ` Heiko Schocher 2014-04-14 8:13 ` [U-Boot] [PATCH v3 0/2] kzm9g i2c bugfix and CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 2 siblings, 1 reply; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-14 4:45 UTC (permalink / raw) To: u-boot Add CONFIG_SYS_GENERIC_BOARD to enable generic board for kzm9g. See doc/README.generic-board Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> --- include/configs/kzm9g.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h index 4d11c7d..5a13ad1 100644 --- a/include/configs/kzm9g.h +++ b/include/configs/kzm9g.h @@ -15,6 +15,7 @@ #define CONFIG_KZM_A9_GT #define CONFIG_RMOBILE_BOARD_STRING "KMC KZM-A9-GT" #define CONFIG_MACH_TYPE MACH_TYPE_KZM9G +#define CONFIG_SYS_GENERIC_BOARD #include <asm/arch/rmobile.h> -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v2 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD 2014-04-14 4:45 ` [U-Boot] [PATCH v2 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi @ 2014-04-14 5:24 ` Heiko Schocher 2014-04-14 6:12 ` Nobuhiro Iwamatsu 0 siblings, 1 reply; 16+ messages in thread From: Heiko Schocher @ 2014-04-14 5:24 UTC (permalink / raw) To: u-boot Hello Tetsuyuki, Am 14.04.2014 06:45, schrieb Tetsuyuki Kobayashi: > Add CONFIG_SYS_GENERIC_BOARD to enable generic board for kzm9g. > See doc/README.generic-board Hmm.. I did not find "doc/README.generic-board" in current mainline tree ... [...] beside of that: Acked-by: Heiko Schocher <hs@denx.de> bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v2 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD 2014-04-14 5:24 ` Heiko Schocher @ 2014-04-14 6:12 ` Nobuhiro Iwamatsu 2014-04-14 7:11 ` Tetsuyuki Kobayashi 0 siblings, 1 reply; 16+ messages in thread From: Nobuhiro Iwamatsu @ 2014-04-14 6:12 UTC (permalink / raw) To: u-boot Hi, 2014-04-14 14:24 GMT+09:00 Heiko Schocher <hs@denx.de>: > Hello Tetsuyuki, > > Am 14.04.2014 06:45, schrieb Tetsuyuki Kobayashi: > >> Add CONFIG_SYS_GENERIC_BOARD to enable generic board for kzm9g. >> See doc/README.generic-board > > > Hmm.. I did not find "doc/README.generic-board" in current mainline > tree ... > > [...] > Maybe, doc/README.generic-board meanes README. > beside of that: > > Acked-by: Heiko Schocher <hs@denx.de> > Thnaks! > bye, > Heiko > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Tetsuyuki, could you re-send this patch with update commit messages? Best regards, Nobuhiro -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v2 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD 2014-04-14 6:12 ` Nobuhiro Iwamatsu @ 2014-04-14 7:11 ` Tetsuyuki Kobayashi 0 siblings, 0 replies; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-14 7:11 UTC (permalink / raw) To: u-boot Hi, (2014/04/14 15:12), Nobuhiro Iwamatsu wrote: > Hi, > > 2014-04-14 14:24 GMT+09:00 Heiko Schocher <hs@denx.de>: >> Hello Tetsuyuki, >> >> Am 14.04.2014 06:45, schrieb Tetsuyuki Kobayashi: >> >>> Add CONFIG_SYS_GENERIC_BOARD to enable generic board for kzm9g. >>> See doc/README.generic-board >> >> >> Hmm.. I did not find "doc/README.generic-board" in current mainline >> tree ... >> >> [...] >> > > Maybe, doc/README.generic-board meanes README. I worked on v2014.04-rc3 and missed reverting "Start the deprecation process for generic board". doc/README.generic-board was deleted now. Anyway, I post revised v3 patch. > >> beside of that: >> >> Acked-by: Heiko Schocher <hs@denx.de> >> ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v3 0/2] kzm9g i2c bugfix and CONFIG_SYS_GENERIC_BOARD 2014-04-14 4:45 [U-Boot] [PATCH v2 0/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi 2014-04-14 4:45 ` [U-Boot] [PATCH v2 1/2] " Tetsuyuki Kobayashi 2014-04-14 4:45 ` [U-Boot] [PATCH v2 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi @ 2014-04-14 8:13 ` Tetsuyuki Kobayashi 2014-04-14 8:13 ` [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi 2014-04-14 8:13 ` [U-Boot] [PATCH v3 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 2 siblings, 2 replies; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-14 8:13 UTC (permalink / raw) To: u-boot Hello, I found i2c probe command bug on kzm9g board and fixed it. Also, add CONFIG_SYS_GENERIC_BOARD for kzm9g board. Changes for v2: - correct typo in commit message. Changes for v3: - prepare dummy data buffer and use it to avoid NULL access. Tetsuyuki Kobayashi (2): i2c: sh_i2c: bugfix: i2c probe command does not work arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD drivers/i2c/sh_i2c.c | 4 +++- include/configs/kzm9g.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) -- 1.7.9.5 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 8:13 ` [U-Boot] [PATCH v3 0/2] kzm9g i2c bugfix and CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi @ 2014-04-14 8:13 ` Tetsuyuki Kobayashi 2014-04-14 8:57 ` Nobuhiro Iwamatsu 2014-04-14 19:17 ` Tom Rini 2014-04-14 8:13 ` [U-Boot] [PATCH v3 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 1 sibling, 2 replies; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-14 8:13 UTC (permalink / raw) To: u-boot This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework Before commit 2035d77d, i2c probe command works properly on kzm9g board. KZM-A9-GT# i2c probe Valid chip addresses: 0C 12 1D 32 39 3D 40 60 After commit 2035d77d, i2c probe command does not work. KZM-A9-GT# i2c probe Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch prepares dummy buffer and read data into it. Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> --- Changes for v2: - correct typo in commit message. Changes for v3: - prepare dummy data buffer and use it to avoid NULL access. drivers/i2c/sh_i2c.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c index cc19100..e7e9692 100644 --- a/drivers/i2c/sh_i2c.c +++ b/drivers/i2c/sh_i2c.c @@ -269,7 +269,9 @@ static int sh_i2c_write(struct i2c_adapter *adap, uint8_t chip, uint addr, static int sh_i2c_probe(struct i2c_adapter *adap, u8 dev) { - return sh_i2c_read(adap, dev, 0, 0, NULL, 0); + u8 dummy[1]; + + return sh_i2c_read(adap, dev, 0, 0, dummy, sizeof dummy); } static unsigned int sh_i2c_set_bus_speed(struct i2c_adapter *adap, -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 8:13 ` [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi @ 2014-04-14 8:57 ` Nobuhiro Iwamatsu 2014-04-14 19:17 ` Tom Rini 1 sibling, 0 replies; 16+ messages in thread From: Nobuhiro Iwamatsu @ 2014-04-14 8:57 UTC (permalink / raw) To: u-boot Applied, thanks for your this fix! Best regards, Nobuhiro 2014-04-14 17:13 GMT+09:00 Tetsuyuki Kobayashi <koba@kmckk.co.jp>: > This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework > > Before commit 2035d77d, i2c probe command works properly on kzm9g board. > > KZM-A9-GT# i2c probe > Valid chip addresses: 0C 12 1D 32 39 3D 40 60 > > After commit 2035d77d, i2c probe command does not work. > > KZM-A9-GT# i2c probe > Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F > > sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch prepares dummy buffer and read data into it. > > Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> > --- > Changes for v2: > - correct typo in commit message. > > Changes for v3: > - prepare dummy data buffer and use it to avoid NULL access. > > drivers/i2c/sh_i2c.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c > index cc19100..e7e9692 100644 > --- a/drivers/i2c/sh_i2c.c > +++ b/drivers/i2c/sh_i2c.c > @@ -269,7 +269,9 @@ static int sh_i2c_write(struct i2c_adapter *adap, uint8_t chip, uint addr, > static int > sh_i2c_probe(struct i2c_adapter *adap, u8 dev) > { > - return sh_i2c_read(adap, dev, 0, 0, NULL, 0); > + u8 dummy[1]; > + > + return sh_i2c_read(adap, dev, 0, 0, dummy, sizeof dummy); > } > > static unsigned int sh_i2c_set_bus_speed(struct i2c_adapter *adap, > -- > 1.7.9.5 > -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 8:13 ` [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi 2014-04-14 8:57 ` Nobuhiro Iwamatsu @ 2014-04-14 19:17 ` Tom Rini 2014-04-15 0:50 ` Tetsuyuki Kobayashi 1 sibling, 1 reply; 16+ messages in thread From: Tom Rini @ 2014-04-14 19:17 UTC (permalink / raw) To: u-boot On Mon, Apr 14, 2014 at 05:13:57PM +0900, Tetsuyuki Kobayashi wrote: > This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework > > Before commit 2035d77d, i2c probe command works properly on kzm9g board. > > KZM-A9-GT# i2c probe > Valid chip addresses: 0C 12 1D 32 39 3D 40 60 > > After commit 2035d77d, i2c probe command does not work. > > KZM-A9-GT# i2c probe > Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F > > sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch prepares dummy buffer and read data into it. > > Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> > --- > Changes for v2: > - correct typo in commit message. > > Changes for v3: > - prepare dummy data buffer and use it to avoid NULL access. > > drivers/i2c/sh_i2c.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c > index cc19100..e7e9692 100644 > --- a/drivers/i2c/sh_i2c.c > +++ b/drivers/i2c/sh_i2c.c > @@ -269,7 +269,9 @@ static int sh_i2c_write(struct i2c_adapter *adap, uint8_t chip, uint addr, > static int > sh_i2c_probe(struct i2c_adapter *adap, u8 dev) > { > - return sh_i2c_read(adap, dev, 0, 0, NULL, 0); > + u8 dummy[1]; > + > + return sh_i2c_read(adap, dev, 0, 0, dummy, sizeof dummy); > } > > static unsigned int sh_i2c_set_bus_speed(struct i2c_adapter *adap, I will take this patch as-is, but please use sizeof(foo) rather than sizeof foo. It's valid but uncommon syntax for the project, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140414/720af566/attachment.pgp> ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work 2014-04-14 19:17 ` Tom Rini @ 2014-04-15 0:50 ` Tetsuyuki Kobayashi 0 siblings, 0 replies; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-15 0:50 UTC (permalink / raw) To: u-boot (2014/04/15 4:17), Tom Rini wrote: > On Mon, Apr 14, 2014 at 05:13:57PM +0900, Tetsuyuki Kobayashi wrote: >> This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework >> >> Before commit 2035d77d, i2c probe command works properly on kzm9g board. >> >> KZM-A9-GT# i2c probe >> Valid chip addresses: 0C 12 1D 32 39 3D 40 60 >> >> After commit 2035d77d, i2c probe command does not work. >> >> KZM-A9-GT# i2c probe >> Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F >> >> sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch prepares dummy buffer and read data into it. >> >> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> >> --- >> Changes for v2: >> - correct typo in commit message. >> >> Changes for v3: >> - prepare dummy data buffer and use it to avoid NULL access. >> >> drivers/i2c/sh_i2c.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c >> index cc19100..e7e9692 100644 >> --- a/drivers/i2c/sh_i2c.c >> +++ b/drivers/i2c/sh_i2c.c >> @@ -269,7 +269,9 @@ static int sh_i2c_write(struct i2c_adapter *adap, uint8_t chip, uint addr, >> static int >> sh_i2c_probe(struct i2c_adapter *adap, u8 dev) >> { >> - return sh_i2c_read(adap, dev, 0, 0, NULL, 0); >> + u8 dummy[1]; >> + >> + return sh_i2c_read(adap, dev, 0, 0, dummy, sizeof dummy); >> } >> >> static unsigned int sh_i2c_set_bus_speed(struct i2c_adapter *adap, > > I will take this patch as-is, but please use sizeof(foo) rather than > sizeof foo. It's valid but uncommon syntax for the project, thanks! > I understand about sizeof(foo). Anyway thank you very much! U-Boot v2014.04 works fine on kzm9g board. ^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v3 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD 2014-04-14 8:13 ` [U-Boot] [PATCH v3 0/2] kzm9g i2c bugfix and CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 2014-04-14 8:13 ` [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi @ 2014-04-14 8:13 ` Tetsuyuki Kobayashi 2014-04-14 8:57 ` Nobuhiro Iwamatsu 1 sibling, 1 reply; 16+ messages in thread From: Tetsuyuki Kobayashi @ 2014-04-14 8:13 UTC (permalink / raw) To: u-boot Add CONFIG_SYS_GENERIC_BOARD to use common/board_[fr].c for kzm9g. Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> --- Changes for v3: - change commit message. include/configs/kzm9g.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h index 4d11c7d..5a13ad1 100644 --- a/include/configs/kzm9g.h +++ b/include/configs/kzm9g.h @@ -15,6 +15,7 @@ #define CONFIG_KZM_A9_GT #define CONFIG_RMOBILE_BOARD_STRING "KMC KZM-A9-GT" #define CONFIG_MACH_TYPE MACH_TYPE_KZM9G +#define CONFIG_SYS_GENERIC_BOARD #include <asm/arch/rmobile.h> -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH v3 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD 2014-04-14 8:13 ` [U-Boot] [PATCH v3 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi @ 2014-04-14 8:57 ` Nobuhiro Iwamatsu 0 siblings, 0 replies; 16+ messages in thread From: Nobuhiro Iwamatsu @ 2014-04-14 8:57 UTC (permalink / raw) To: u-boot Applied, thanks! Best regards, Nobuhiro 2014-04-14 17:13 GMT+09:00 Tetsuyuki Kobayashi <koba@kmckk.co.jp>: > Add CONFIG_SYS_GENERIC_BOARD to use common/board_[fr].c for kzm9g. > > Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp> > --- > Changes for v3: > - change commit message. > > include/configs/kzm9g.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h > index 4d11c7d..5a13ad1 100644 > --- a/include/configs/kzm9g.h > +++ b/include/configs/kzm9g.h > @@ -15,6 +15,7 @@ > #define CONFIG_KZM_A9_GT > #define CONFIG_RMOBILE_BOARD_STRING "KMC KZM-A9-GT" > #define CONFIG_MACH_TYPE MACH_TYPE_KZM9G > +#define CONFIG_SYS_GENERIC_BOARD > > #include <asm/arch/rmobile.h> > > -- > 1.7.9.5 > -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2014-04-15 0:50 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-04-14 4:45 [U-Boot] [PATCH v2 0/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi 2014-04-14 4:45 ` [U-Boot] [PATCH v2 1/2] " Tetsuyuki Kobayashi 2014-04-14 5:22 ` Heiko Schocher 2014-04-14 6:09 ` Nobuhiro Iwamatsu 2014-04-14 6:49 ` Tetsuyuki Kobayashi 2014-04-14 4:45 ` [U-Boot] [PATCH v2 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 2014-04-14 5:24 ` Heiko Schocher 2014-04-14 6:12 ` Nobuhiro Iwamatsu 2014-04-14 7:11 ` Tetsuyuki Kobayashi 2014-04-14 8:13 ` [U-Boot] [PATCH v3 0/2] kzm9g i2c bugfix and CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 2014-04-14 8:13 ` [U-Boot] [PATCH v3 1/2] i2c: sh_i2c: bugfix: i2c probe command does not work Tetsuyuki Kobayashi 2014-04-14 8:57 ` Nobuhiro Iwamatsu 2014-04-14 19:17 ` Tom Rini 2014-04-15 0:50 ` Tetsuyuki Kobayashi 2014-04-14 8:13 ` [U-Boot] [PATCH v3 2/2] arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD Tetsuyuki Kobayashi 2014-04-14 8:57 ` Nobuhiro Iwamatsu
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.