Message ID | 1373486763-13091-2-git-send-email-dmurphy@ti.com |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show |
On 07/10/2013 03:06 PM, Dan Murphy wrote: > Configure the tca6424 gpio expander > This allows use of the debug and tri color LEDs. > > Signed-off-by: Dan Murphy <dmurphy@ti.com> > --- > board/ti/omap5_uevm/evm.c | 21 +++++++++++++++++++++ > board/ti/omap5_uevm/mux_data.h | 2 ++ > include/configs/omap5_uevm.h | 5 +++++ > 3 files changed, 28 insertions(+) > > diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c > index 90046e8..0e9a559 100644 > --- a/board/ti/omap5_uevm/evm.c > +++ b/board/ti/omap5_uevm/evm.c > @@ -26,6 +26,7 @@ > #include <palmas.h> > #include <asm/arch/sys_proto.h> > #include <asm/arch/mmc_host_def.h> > +#include <tca642x.h> > > #include "mux_data.h" > > @@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = { > "Board: OMAP5430 EVM\n" > }; > > +/* @brief tca642x_init - Initial states for the GPIO expander documentation style? /* * @brief ? > + * input reg, output reg, polarity reg, configuration reg > + */ > +struct tca642x_bank_info tca642x_init[] = { > + { .input_reg = 0x00, > + .output_reg = 0x04, > + .polarity_reg = 0x00, > + .configuration_reg = 0x80 }, > + { .input_reg = 0x00, > + .output_reg = 0x00, > + .polarity_reg = 0x00, > + .configuration_reg = 0xff }, > + { .input_reg = 0x00, > + .output_reg = 0x00, > + .polarity_reg = 0x00, > + .configuration_reg = 0x40 }, > +}; > + > /** > * @brief board_init > * > @@ -46,6 +65,8 @@ int board_init(void) > gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM; > gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ > > + tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init); > + > return 0; > } > > diff --git a/board/ti/omap5_uevm/mux_data.h b/board/ti/omap5_uevm/mux_data.h > index a82795d..7e6415e 100644 > --- a/board/ti/omap5_uevm/mux_data.h > +++ b/board/ti/omap5_uevm/mux_data.h > @@ -56,6 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = { > {USBD0_HS_DP, (IEN | M0)}, /* USBD0_HS_DP */ > {USBD0_HS_DM, (IEN | M0)}, /* USBD0_HS_DM */ > {USBD0_SS_RX, (IEN | M0)}, /* USBD0_SS_RX */ > + {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */ nit pick -> SCL (or i2c clk) is out put from master - always. IEN enables full duplex, but anyways.. just a nitpick :) > + {I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */ > > }; > > diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h > index 46dacc2..bee1278 100644 > --- a/include/configs/omap5_uevm.h > +++ b/include/configs/omap5_uevm.h > @@ -53,6 +53,11 @@ > #define CONFIG_PARTITION_UUIDS > #define CONFIG_CMD_PART > > +#define CONFIG_TCA642X > +#define CONFIG_CMD_TCA642X > +#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4 > +#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22 > + > #define CONFIG_SYS_PROMPT "OMAP5432 uEVM # " > > #define CONSOLEDEV "ttyO2" > Else, no further comments from me. -- Regards, Nishanth Menon
On Wed, Jul 10, 2013 at 06:56:15PM -0500, Nishanth Menon wrote: > On 07/10/2013 03:06 PM, Dan Murphy wrote: > >Configure the tca6424 gpio expander > >This allows use of the debug and tri color LEDs. > > > >Signed-off-by: Dan Murphy <dmurphy@ti.com> > >--- > > board/ti/omap5_uevm/evm.c | 21 +++++++++++++++++++++ > > board/ti/omap5_uevm/mux_data.h | 2 ++ > > include/configs/omap5_uevm.h | 5 +++++ > > 3 files changed, 28 insertions(+) > > > >diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c > >index 90046e8..0e9a559 100644 > >--- a/board/ti/omap5_uevm/evm.c > >+++ b/board/ti/omap5_uevm/evm.c > >@@ -26,6 +26,7 @@ > > #include <palmas.h> > > #include <asm/arch/sys_proto.h> > > #include <asm/arch/mmc_host_def.h> > >+#include <tca642x.h> > > > > #include "mux_data.h" > > > >@@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = { > > "Board: OMAP5430 EVM\n" > > }; > > > >+/* @brief tca642x_init - Initial states for the GPIO expander > documentation style? > /* > * @brief > ? /** * @brief even :) And, no other comments.
On 07/11/2013 09:30 AM, Tom Rini wrote: > On Wed, Jul 10, 2013 at 06:56:15PM -0500, Nishanth Menon wrote: >> On 07/10/2013 03:06 PM, Dan Murphy wrote: >>> Configure the tca6424 gpio expander >>> This allows use of the debug and tri color LEDs. >>> >>> Signed-off-by: Dan Murphy <dmurphy@ti.com> >>> --- >>> board/ti/omap5_uevm/evm.c | 21 +++++++++++++++++++++ >>> board/ti/omap5_uevm/mux_data.h | 2 ++ >>> include/configs/omap5_uevm.h | 5 +++++ >>> 3 files changed, 28 insertions(+) >>> >>> diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c >>> index 90046e8..0e9a559 100644 >>> --- a/board/ti/omap5_uevm/evm.c >>> +++ b/board/ti/omap5_uevm/evm.c >>> @@ -26,6 +26,7 @@ >>> #include <palmas.h> >>> #include <asm/arch/sys_proto.h> >>> #include <asm/arch/mmc_host_def.h> >>> +#include <tca642x.h> >>> >>> #include "mux_data.h" >>> >>> @@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = { >>> "Board: OMAP5430 EVM\n" >>> }; >>> >>> +/* @brief tca642x_init - Initial states for the GPIO expander >> documentation style? >> /* >> * @brief >> ? > /** > * @brief > > even :) > > And, no other comments. > Got it will fix it
On 07/10/2013 06:56 PM, Nishanth Menon wrote: > On 07/10/2013 03:06 PM, Dan Murphy wrote: >> Configure the tca6424 gpio expander >> This allows use of the debug and tri color LEDs. >> >> Signed-off-by: Dan Murphy <dmurphy@ti.com> >> --- >> board/ti/omap5_uevm/evm.c | 21 +++++++++++++++++++++ >> board/ti/omap5_uevm/mux_data.h | 2 ++ >> include/configs/omap5_uevm.h | 5 +++++ >> 3 files changed, 28 insertions(+) >> >> diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c >> index 90046e8..0e9a559 100644 >> --- a/board/ti/omap5_uevm/evm.c >> +++ b/board/ti/omap5_uevm/evm.c >> @@ -26,6 +26,7 @@ >> #include <palmas.h> >> #include <asm/arch/sys_proto.h> >> #include <asm/arch/mmc_host_def.h> >> +#include <tca642x.h> >> >> #include "mux_data.h" >> >> @@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = { >> "Board: OMAP5430 EVM\n" >> }; >> >> +/* @brief tca642x_init - Initial states for the GPIO expander > documentation style? > /* > * @brief > ? >> + * input reg, output reg, polarity reg, configuration reg >> + */ >> +struct tca642x_bank_info tca642x_init[] = { >> + { .input_reg = 0x00, >> + .output_reg = 0x04, >> + .polarity_reg = 0x00, >> + .configuration_reg = 0x80 }, >> + { .input_reg = 0x00, >> + .output_reg = 0x00, >> + .polarity_reg = 0x00, >> + .configuration_reg = 0xff }, >> + { .input_reg = 0x00, >> + .output_reg = 0x00, >> + .polarity_reg = 0x00, >> + .configuration_reg = 0x40 }, >> +}; >> + >> /** >> * @brief board_init >> * >> @@ -46,6 +65,8 @@ int board_init(void) >> gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM; >> gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ >> >> + tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init); >> + >> return 0; >> } >> >> diff --git a/board/ti/omap5_uevm/mux_data.h b/board/ti/omap5_uevm/mux_data.h >> index a82795d..7e6415e 100644 >> --- a/board/ti/omap5_uevm/mux_data.h >> +++ b/board/ti/omap5_uevm/mux_data.h >> @@ -56,6 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = { >> {USBD0_HS_DP, (IEN | M0)}, /* USBD0_HS_DP */ >> {USBD0_HS_DM, (IEN | M0)}, /* USBD0_HS_DM */ >> {USBD0_SS_RX, (IEN | M0)}, /* USBD0_SS_RX */ >> + {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */ > nit pick -> SCL (or i2c clk) is out put from master - always. IEN enables full duplex, but anyways.. just a nitpick :) > OK I changed this and did a test and reads fail without the IEN set. This is to sync the client clocks. >> + {I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */ >> >> }; >> >> diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h >> index 46dacc2..bee1278 100644 >> --- a/include/configs/omap5_uevm.h >> +++ b/include/configs/omap5_uevm.h >> @@ -53,6 +53,11 @@ >> #define CONFIG_PARTITION_UUIDS >> #define CONFIG_CMD_PART >> >> +#define CONFIG_TCA642X >> +#define CONFIG_CMD_TCA642X >> +#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4 >> +#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22 >> + >> #define CONFIG_SYS_PROMPT "OMAP5432 uEVM # " >> >> #define CONSOLEDEV "ttyO2" >> > > Else, > no further comments from me. > -- > Regards, > Nishanth Menon
On Jul 11, 2013 10:55 AM, "Dan Murphy" <dmurphy@ti.com> wrote: > > On 07/10/2013 06:56 PM, Nishanth Menon wrote: > > On 07/10/2013 03:06 PM, Dan Murphy wrote: > >> Configure the tca6424 gpio expander > >> This allows use of the debug and tri color LEDs. > >> > >> Signed-off-by: Dan Murphy <dmurphy@ti.com> > >> --- > >> board/ti/omap5_uevm/evm.c | 21 +++++++++++++++++++++ > >> board/ti/omap5_uevm/mux_data.h | 2 ++ > >> include/configs/omap5_uevm.h | 5 +++++ > >> 3 files changed, 28 insertions(+) > >> > >> diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c > >> index 90046e8..0e9a559 100644 > >> --- a/board/ti/omap5_uevm/evm.c > >> +++ b/board/ti/omap5_uevm/evm.c > >> @@ -26,6 +26,7 @@ > >> #include <palmas.h> > >> #include <asm/arch/sys_proto.h> > >> #include <asm/arch/mmc_host_def.h> > >> +#include <tca642x.h> > >> > >> #include "mux_data.h" > >> > >> @@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = { > >> "Board: OMAP5430 EVM\n" > >> }; > >> > >> +/* @brief tca642x_init - Initial states for the GPIO expander > > documentation style? > > /* > > * @brief > > ? > >> + * input reg, output reg, polarity reg, configuration reg > >> + */ > >> +struct tca642x_bank_info tca642x_init[] = { > >> + { .input_reg = 0x00, > >> + .output_reg = 0x04, > >> + .polarity_reg = 0x00, > >> + .configuration_reg = 0x80 }, > >> + { .input_reg = 0x00, > >> + .output_reg = 0x00, > >> + .polarity_reg = 0x00, > >> + .configuration_reg = 0xff }, > >> + { .input_reg = 0x00, > >> + .output_reg = 0x00, > >> + .polarity_reg = 0x00, > >> + .configuration_reg = 0x40 }, > >> +}; > >> + > >> /** > >> * @brief board_init > >> * > >> @@ -46,6 +65,8 @@ int board_init(void) > >> gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM; > >> gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ > >> > >> + tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init); > >> + > >> return 0; > >> } > >> > >> diff --git a/board/ti/omap5_uevm/mux_data.h b/board/ti/omap5_uevm/mux_data.h > >> index a82795d..7e6415e 100644 > >> --- a/board/ti/omap5_uevm/mux_data.h > >> +++ b/board/ti/omap5_uevm/mux_data.h > >> @@ -56,6 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = { > >> {USBD0_HS_DP, (IEN | M0)}, /* USBD0_HS_DP */ > >> {USBD0_HS_DM, (IEN | M0)}, /* USBD0_HS_DM */ > >> {USBD0_SS_RX, (IEN | M0)}, /* USBD0_SS_RX */ > >> + {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */ > > nit pick -> SCL (or i2c clk) is out put from master - always. IEN enables full duplex, but anyways.. just a nitpick :) > > > OK I changed this and did a test and reads fail without the IEN set. > This is to sync the client clocks. Scl? I2c clock? Does not work without input- something is fishy no? > >> + {I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */ > >> > >> }; > >> > >> diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h > >> index 46dacc2..bee1278 100644 > >> --- a/include/configs/omap5_uevm.h > >> +++ b/include/configs/omap5_uevm.h > >> @@ -53,6 +53,11 @@ > >> #define CONFIG_PARTITION_UUIDS > >> #define CONFIG_CMD_PART > >> > >> +#define CONFIG_TCA642X > >> +#define CONFIG_CMD_TCA642X > >> +#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4 > >> +#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22 > >> + > >> #define CONFIG_SYS_PROMPT "OMAP5432 uEVM # " > >> > >> #define CONSOLEDEV "ttyO2" > >> > > > > Else, > > no further comments from me. > > -- > > Regards, > > Nishanth Menon > > > -- > ------------------ > Dan Murphy > > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot
NM On 07/11/2013 01:02 PM, Nishanth Menon wrote: <snip> >>> diff --git a/board/ti/omap5_uevm/mux_data.h > b/board/ti/omap5_uevm/mux_data.h >>>> index a82795d..7e6415e 100644 >>>> --- a/board/ti/omap5_uevm/mux_data.h >>>> +++ b/board/ti/omap5_uevm/mux_data.h >>>> @@ -56,6 +56,8 @@ const struct pad_conf_entry > core_padconf_array_essential[] = { >>>> {USBD0_HS_DP, (IEN | M0)}, /* USBD0_HS_DP */ >>>> {USBD0_HS_DM, (IEN | M0)}, /* USBD0_HS_DM */ >>>> {USBD0_SS_RX, (IEN | M0)}, /* USBD0_SS_RX */ >>>> + {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */ >>> nit pick -> SCL (or i2c clk) is out put from master - always. IEN > enables full duplex, but anyways.. just a nitpick :) >> OK I changed this and did a test and reads fail without the IEN set. >> This is to sync the client clocks. > Scl? I2c clock? Does not work without input- something is fishy no? Nope. There is clock synchronization and clock arbitration that happens and the I2C master needs to see the SCL as an input. Kernel configures the I2C mux for 1 and 5 the same way. <snip>
On Fri, Jul 12, 2013 at 12:30 PM, Dan Murphy <dmurphy@ti.com> wrote: > On 07/11/2013 01:02 PM, Nishanth Menon wrote: >>>> diff --git a/board/ti/omap5_uevm/mux_data.h >> b/board/ti/omap5_uevm/mux_data.h >>>>> index a82795d..7e6415e 100644 >>>>> --- a/board/ti/omap5_uevm/mux_data.h >>>>> +++ b/board/ti/omap5_uevm/mux_data.h >>>>> @@ -56,6 +56,8 @@ const struct pad_conf_entry >> core_padconf_array_essential[] = { >>>>> {USBD0_HS_DP, (IEN | M0)}, /* USBD0_HS_DP */ >>>>> {USBD0_HS_DM, (IEN | M0)}, /* USBD0_HS_DM */ >>>>> {USBD0_SS_RX, (IEN | M0)}, /* USBD0_SS_RX */ >>>>> + {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */ >>>> nit pick -> SCL (or i2c clk) is out put from master - always. IEN >> enables full duplex, but anyways.. just a nitpick :) >>> OK I changed this and did a test and reads fail without the IEN set. >>> This is to sync the client clocks. >> Scl? I2c clock? Does not work without input- something is fishy no? > Nope. There is clock synchronization and clock arbitration that happens and the I2C master needs to see the SCL as an input. Also, Table 24-1. HS I2C Input/Output in OMAP5 ES2.0 TRM Rev U supports the requirement of SCL being input as well. I think you mean bus busy condition here[1] rather than multi-master arbitration? in the case of arbitration, the SDA will be monitored than SCL - See "Figure 24-9. HS I2C Arbitration Between Master Transmitters" in TRM. Bus busy on the other hand needs stop condition detection for transmission which involves SCL and SDA. yet another need is the requirement to support clock stretching[2] (where the i2c slave holds the SCL low while it does "something"). Either way, it explains why SCL needs to be in IEN. [1] http://www.i2c-bus.org/MultiMaster/ [2] http://www.i2c-bus.org/clock-stretching/ Regards, Nishanth Menon
diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c index 90046e8..0e9a559 100644 --- a/board/ti/omap5_uevm/evm.c +++ b/board/ti/omap5_uevm/evm.c @@ -26,6 +26,7 @@ #include <palmas.h> #include <asm/arch/sys_proto.h> #include <asm/arch/mmc_host_def.h> +#include <tca642x.h> #include "mux_data.h" @@ -35,6 +36,24 @@ const struct omap_sysinfo sysinfo = { "Board: OMAP5430 EVM\n" }; +/* @brief tca642x_init - Initial states for the GPIO expander + * input reg, output reg, polarity reg, configuration reg + */ +struct tca642x_bank_info tca642x_init[] = { + { .input_reg = 0x00, + .output_reg = 0x04, + .polarity_reg = 0x00, + .configuration_reg = 0x80 }, + { .input_reg = 0x00, + .output_reg = 0x00, + .polarity_reg = 0x00, + .configuration_reg = 0xff }, + { .input_reg = 0x00, + .output_reg = 0x00, + .polarity_reg = 0x00, + .configuration_reg = 0x40 }, +}; + /** * @brief board_init * @@ -46,6 +65,8 @@ int board_init(void) gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM; gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ + tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init); + return 0; } diff --git a/board/ti/omap5_uevm/mux_data.h b/board/ti/omap5_uevm/mux_data.h index a82795d..7e6415e 100644 --- a/board/ti/omap5_uevm/mux_data.h +++ b/board/ti/omap5_uevm/mux_data.h @@ -56,6 +56,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = { {USBD0_HS_DP, (IEN | M0)}, /* USBD0_HS_DP */ {USBD0_HS_DM, (IEN | M0)}, /* USBD0_HS_DM */ {USBD0_SS_RX, (IEN | M0)}, /* USBD0_SS_RX */ + {I2C5_SCL, (IEN | M0)}, /* I2C5_SCL */ + {I2C5_SDA, (IEN | M0)}, /* I2C5_SDA */ }; diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h index 46dacc2..bee1278 100644 --- a/include/configs/omap5_uevm.h +++ b/include/configs/omap5_uevm.h @@ -53,6 +53,11 @@ #define CONFIG_PARTITION_UUIDS #define CONFIG_CMD_PART +#define CONFIG_TCA642X +#define CONFIG_CMD_TCA642X +#define CONFIG_SYS_I2C_TCA642X_BUS_NUM 4 +#define CONFIG_SYS_I2C_TCA642X_ADDR 0x22 + #define CONFIG_SYS_PROMPT "OMAP5432 uEVM # " #define CONSOLEDEV "ttyO2"
Configure the tca6424 gpio expander This allows use of the debug and tri color LEDs. Signed-off-by: Dan Murphy <dmurphy@ti.com> --- board/ti/omap5_uevm/evm.c | 21 +++++++++++++++++++++ board/ti/omap5_uevm/mux_data.h | 2 ++ include/configs/omap5_uevm.h | 5 +++++ 3 files changed, 28 insertions(+)