Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-09 Thread Stefano Babic
On 09/10/2014 02:28, Marek Vasut wrote:
 On Thursday, October 09, 2014 at 02:13:48 AM, Nikolay Dimitrov wrote:
 Hi Marek,
 
 [...]
 
 @Sean: Do you have any comments on USB hub reset stuff? Should we ditch
 entirely the reset code, or should we modify it somehow to work
 properly?

 OK, so it's just this USB that remains, right ?

 That's correct.

 There are a bunch of non-critical things for fixing also, but we'll
 negotiate later about them :D.
 
 Well what are those ?
 
 Stefano, is there still any chance that a V6 of Novena would go into this 
 release? I guess those chances are slim, right ?

Right. It looks like that it is better to take the time and fixing the
open issues, else having the board just quickly into the release.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-09 Thread Stefano Babic
Hi Marek,

On 06/10/2014 18:02, Marek Vasut wrote:
 Add support for the Kosagi Novena board. Currently supported are:
 - I2C busses
 - FEC Ethernet
 - MMC0, MMC1, Booting from MMC
 - SATA
 - USB ports
 - USB Ethernet
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Stefano Babic sba...@denx.de
 Cc: Sean Cross x...@kosagi.com
 Cc: Nikolay Dimitrov picmas...@mail.bg
 ---
  arch/arm/Kconfig |   4 +
  board/kosagi/novena/Kconfig  |  23 ++
  board/kosagi/novena/Makefile |  11 +
  board/kosagi/novena/novena.c | 342 +++
  board/kosagi/novena/novena_spl.c | 581 
 +++
  board/kosagi/novena/setup.cfg|  47 
  configs/novena_defconfig |   4 +
  include/configs/imx6_spl.h   |   2 +-
  include/configs/novena.h | 303 
  9 files changed, 1316 insertions(+), 1 deletion(-)
  create mode 100644 board/kosagi/novena/Kconfig
  create mode 100644 board/kosagi/novena/Makefile
  create mode 100644 board/kosagi/novena/novena.c
  create mode 100644 board/kosagi/novena/novena_spl.c
  create mode 100644 board/kosagi/novena/setup.cfg
  create mode 100644 configs/novena_defconfig
  create mode 100644 include/configs/novena.h
 
 V2: - Drop the tegra_keyboard_init() comment altogether
 - Immediatelly return from the SD controller probe function on failure
 - Rename PFUZE100_PMIC to just PFUZE100
 - Fix the IMX OTP support with CMD_FUSE
 - Enabling LVDS clock is still in place, since this is coming soon.
 V3: - Zap rootpath builtin env
 V4: - Zap the checkpatch issues
 - Update comments
 V5: - Don't configure VGEN1
 - Set FPGA into reset in SPL
 - Drop ECSPI1 and add ECSPI3 mux
 - Drop UART1 and add UART3, UART4 muxes
 - Add separate mux option for the RGMII pins which doesn't set SPEED field
 - Move the configuration of RGMII after they were configured in GPIO mode
 
 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
 index 106aed9..4da1923 100644
 --- a/arch/arm/Kconfig
 +++ b/arch/arm/Kconfig
 @@ -411,6 +411,9 @@ config TARGET_GW_VENTANA
  config TARGET_HUMMINGBOARD
   bool Support hummingboard
  
 +config TARGET_KOSAGI_NOVENA
 + bool Support Kosagi Novena
 +
  config TARGET_TQMA6
   bool TQ Systems TQMa6 board
  
 @@ -637,6 +640,7 @@ source board/imx31_phycore/Kconfig
  source board/isee/igep0033/Kconfig
  source board/jornada/Kconfig
  source board/karo/tx25/Kconfig
 +source board/kosagi/novena/Kconfig
  source board/logicpd/imx27lite/Kconfig
  source board/logicpd/imx31_litekit/Kconfig
  source board/mpl/vcma9/Kconfig
 diff --git a/board/kosagi/novena/Kconfig b/board/kosagi/novena/Kconfig
 new file mode 100644
 index 000..4e52be9
 --- /dev/null
 +++ b/board/kosagi/novena/Kconfig
 @@ -0,0 +1,23 @@
 +if TARGET_KOSAGI_NOVENA
 +
 +config SYS_CPU
 + string
 + default armv7

See http://patchwork.ozlabs.org/patch/397186/.

According to Masahiro, strings is not required and can be dropped.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-09 Thread Nikolay Dimitrov

Hi Sean,

On 10/09/2014 08:38 AM, Sean Cross wrote:

I'll be sure to have Bunnie post a new schematic when he returns
tomorrow.  For now, the ECO on our wiki is the authoritative source.
This is curently the only ECO for the final PVT2 board:
http://www.kosagi.com/w/index.php?title=Novena_PVT2_ECO_List#ECO22:_swap_audio_control_option


Thanks for sharing the link to ECO list, it will definitely help (well, 
shame on me that I didn't find this earler, doh).


Still, if you think it's possible to release at some point an updated 
PDF schematic that integrates all currently approved ECOs, it will be 
even better.


Regards,
Nikolay
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-09 Thread Marek Vasut
On Thursday, October 09, 2014 at 09:31:35 AM, Stefano Babic wrote:
 On 09/10/2014 02:28, Marek Vasut wrote:
  On Thursday, October 09, 2014 at 02:13:48 AM, Nikolay Dimitrov wrote:
  Hi Marek,
  
  [...]
  
  @Sean: Do you have any comments on USB hub reset stuff? Should we
  ditch entirely the reset code, or should we modify it somehow to work
  properly?
  
  OK, so it's just this USB that remains, right ?
  
  That's correct.
  
  There are a bunch of non-critical things for fixing also, but we'll
  negotiate later about them :D.
  
  Well what are those ?
  
  Stefano, is there still any chance that a V6 of Novena would go into this
  release? I guess those chances are slim, right ?
 
 Right. It looks like that it is better to take the time and fixing the
 open issues, else having the board just quickly into the release.

Works for me either way, thanks!

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-09 Thread Marek Vasut
On Thursday, October 09, 2014 at 09:36:13 AM, Stefano Babic wrote:
 Hi Marek,
 
 On 06/10/2014 18:02, Marek Vasut wrote:
  Add support for the Kosagi Novena board. Currently supported are:
  - I2C busses
  - FEC Ethernet
  - MMC0, MMC1, Booting from MMC
  - SATA
  - USB ports
  - USB Ethernet
  
  Signed-off-by: Marek Vasut ma...@denx.de
  Cc: Stefano Babic sba...@denx.de
  Cc: Sean Cross x...@kosagi.com
  Cc: Nikolay Dimitrov picmas...@mail.bg
  ---
  
   arch/arm/Kconfig |   4 +
   board/kosagi/novena/Kconfig  |  23 ++
   board/kosagi/novena/Makefile |  11 +
   board/kosagi/novena/novena.c | 342 +++
   board/kosagi/novena/novena_spl.c | 581
   +++ board/kosagi/novena/setup.cfg  
|  47 
   configs/novena_defconfig |   4 +
   include/configs/imx6_spl.h   |   2 +-
   include/configs/novena.h | 303 
   9 files changed, 1316 insertions(+), 1 deletion(-)
   create mode 100644 board/kosagi/novena/Kconfig
   create mode 100644 board/kosagi/novena/Makefile
   create mode 100644 board/kosagi/novena/novena.c
   create mode 100644 board/kosagi/novena/novena_spl.c
   create mode 100644 board/kosagi/novena/setup.cfg
   create mode 100644 configs/novena_defconfig
   create mode 100644 include/configs/novena.h
  
  V2: - Drop the tegra_keyboard_init() comment altogether
  
  - Immediatelly return from the SD controller probe function on
  failure - Rename PFUZE100_PMIC to just PFUZE100
  - Fix the IMX OTP support with CMD_FUSE
  - Enabling LVDS clock is still in place, since this is coming soon.
  
  V3: - Zap rootpath builtin env
  V4: - Zap the checkpatch issues
  
  - Update comments
  
  V5: - Don't configure VGEN1
  
  - Set FPGA into reset in SPL
  - Drop ECSPI1 and add ECSPI3 mux
  - Drop UART1 and add UART3, UART4 muxes
  - Add separate mux option for the RGMII pins which doesn't set SPEED
  field - Move the configuration of RGMII after they were configured
  in GPIO mode
  
  diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
  index 106aed9..4da1923 100644
  --- a/arch/arm/Kconfig
  +++ b/arch/arm/Kconfig
  @@ -411,6 +411,9 @@ config TARGET_GW_VENTANA
  
   config TARGET_HUMMINGBOARD
   
  bool Support hummingboard
  
  +config TARGET_KOSAGI_NOVENA
  +   bool Support Kosagi Novena
  +
  
   config TARGET_TQMA6
   
  bool TQ Systems TQMa6 board
  
  @@ -637,6 +640,7 @@ source board/imx31_phycore/Kconfig
  
   source board/isee/igep0033/Kconfig
   source board/jornada/Kconfig
   source board/karo/tx25/Kconfig
  
  +source board/kosagi/novena/Kconfig
  
   source board/logicpd/imx27lite/Kconfig
   source board/logicpd/imx31_litekit/Kconfig
   source board/mpl/vcma9/Kconfig
  
  diff --git a/board/kosagi/novena/Kconfig b/board/kosagi/novena/Kconfig
  new file mode 100644
  index 000..4e52be9
  --- /dev/null
  +++ b/board/kosagi/novena/Kconfig
  @@ -0,0 +1,23 @@
  +if TARGET_KOSAGI_NOVENA
  +
  +config SYS_CPU
  +   string
  +   default armv7
 
 See http://patchwork.ozlabs.org/patch/397186/.
 
 According to Masahiro, strings is not required and can be dropped.

Dropped, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-09 Thread Marek Vasut
On Thursday, October 09, 2014 at 03:04:49 AM, Nikolay Dimitrov wrote:
 Hi Marek,

Hi!

 On 10/09/2014 03:28 AM, Marek Vasut wrote:
  On Thursday, October 09, 2014 at 02:13:48 AM, Nikolay Dimitrov wrote:
  Hi Marek,
  
  [...]
  
  @Sean: Do you have any comments on USB hub reset stuff? Should we
  ditch entirely the reset code, or should we modify it somehow to work
  properly?
  
  OK, so it's just this USB that remains, right ?
  
  That's correct.
  
  There are a bunch of non-critical things for fixing also, but we'll
  negotiate later about them :D.
  
  Well what are those ?
 
 Stuff like removing GD memset from Novena code, as it's now handled by
 crt0.S, removing microSD CD pin definition as it's not used at all,

I fixed those two, thanks!

 improve PHY reset (both timing and signal conflicts), and about 5-6
 similar things which I can't remember, need to check again your patch.
 
 As I said, I feel bad for torturing you anyway, and tried to think which
 are the critical things, which will break stuff if not fixed. The other
 fixes need another round of more discussions, so can be pushed later.

OK, but don't worry about the discussion. That's really perfectly OK.

Thank you!

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread Sean Cross
On 08/10/2014 05:55, Nikolay Dimitrov wrote:
 Hi Marek,

 I'm marking only the critical issues that are left unfixed from
 previous conversations, to speed-up the process a little bit.
 I'll send later patches for the non-critical issues to spare you the
 extra work (and I'm sure my constructive criticism is already boring
 :D ).


 On 10/06/2014 07:02 PM, Marek Vasut wrote:
 +#define NOVENA_USB_HUB_RESETIMX_GPIO_NR(7, 12)
 ...
 +/*
 + * USB
 + */
 +#ifdef CONFIG_USB_EHCI_MX6
 +int board_ehci_hcd_init(int port)
 +{
 +/* Reset USB hub */
 +if (port == 1) {
 +gpio_set_value(NOVENA_USB_HUB_RESET, 0);
 +mdelay(2);
 +gpio_set_value(NOVENA_USB_HUB_RESET, 1);
 +}
 +return 0;
 +}
 +#endif

 As we previously discussed, this pin definition conflicts with
 NOVENA_PCIE_POWER_ON_GPIO (GPIO7_IO12 is connected to PCIE_PWRON), so
 by asserting it, you'll turn-off the wrong sub-system.

 Currently the USB hub is reset only by system reset (RESETBMCU
 asserted by the PMIC). I don't see how the CPU can selectively reset
 the USB hub via a GPIO, so it would be better to remove the reset code.

 @Sean - can you please confirm/reject this finding?


 +#define NOVENA_AUDIO_PWRONIMX_GPIO_NR(5, 17)
 ...
 +/*
 + * Audio
 + */
 +static iomux_v3_cfg_t audio_pads[] = {
 +/* AUD_PWRON */
 +MX6_PAD_DISP0_DAT23__GPIO5_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),
 +};

 The speaker amplifiers will still be disabled, as AUDIO_PWRON is not
 connected to them (R30A is marked as DNP). You need to add one more
 GPIO to enable the speaker amplifiers, here's the fix:

 #define NOVENA_AUDIO_PWRONIMX_GPIO_NR(5, 17)
 #define NOVENA_AUDIO_SPK_AMP_ONIMX_GPIO_NR(4, 9)

 /*
  * Audio
  */
 static iomux_v3_cfg_t audio_pads[] = {
 /* AUD_PWRON */
 MX6_PAD_KEY_ROW1__GPIO5_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),

 /* Speakers' amplifiers #SHDWN  */
 MX6_PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };

 static void novena_spl_setup_iomux_audio(void)
 {
 imx_iomux_v3_setup_multiple_pads(audio_pads, ARRAY_SIZE(audio_pads));

 gpio_direction_output(NOVENA_AUDIO_PWRON, 1);
 gpio_direction_output(NOVENA_AUDIO_SPK_AMP_ON, 1);
 }


 Side comment: If someone needs to talk to the Audio Codec via I2C3 in
 U-Boot environment, don't be surprised if the codec doesn't respond to
 any I2C requests at all (I've had such issues with SGTL5000). The most
 probable reason is that the codec doesn't receive reference clock from
 imx6 GPIO0. This is not a critical issues as later the kernel muxes
 this GPIO0 properly, but keep this in mind if you want to hack the
 audio-codec at low level.

The audio codec ought to answer even when the reference clock isn't
active.  I actually can't recall, but I think the digital side still
works.  The audio codec needs to be turned on because otherwise it will
pull the SCL and SCK lines low, blocking I2C3 from working at all.

Actually, now that I'm looking at it, we just had to make an ECO to get
rid of SPK_AMP_ON.  It is now ganged to AUDIO_PWRON, because SPK_AMP_ON
was accidentally dual-purposed as a GPIO for the front button on the
desktop / laptop.  This change was made very recently (last Friday I
think), and we'll be switching resistors on the mainboard when they're
built in order to make the change.  That pin should still be muxed as a
GPIO, it's just an input now rather than an output.


Sean
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread picmaster
Hi Sean,

- Цитат от Sean Cross (x...@kosagi.com), на 08.10.2014 в 10:47 -

 On 08/10/2014 05:55, Nikolay Dimitrov wrote:
 Hi Marek,

 I'm marking only the critical issues that are left unfixed from
 previous conversations, to speed-up the process a little bit.
 I'll send later patches for the non-critical issues to spare you the
 extra work (and I'm sure my constructive criticism is already boring
 :D ).


 On 10/06/2014 07:02 PM, Marek Vasut wrote:
 +#define NOVENA_USB_HUB_RESETIMX_GPIO_NR(7, 12)
 ...
 +/*
 + * USB
 + */
 +#ifdef CONFIG_USB_EHCI_MX6
 +int board_ehci_hcd_init(int port)
 +{
 +/* Reset USB hub */
 +if (port == 1) {
 +gpio_set_value(NOVENA_USB_HUB_RESET, 0);
 +mdelay(2);
 +gpio_set_value(NOVENA_USB_HUB_RESET, 1);
 +}
 +return 0;
 +}
 +#endif

 As we previously discussed, this pin definition conflicts with
 NOVENA_PCIE_POWER_ON_GPIO (GPIO7_IO12 is connected to PCIE_PWRON), so
 by asserting it, you'll turn-off the wrong sub-system.

 Currently the USB hub is reset only by system reset (RESETBMCU
 asserted by the PMIC). I don't see how the CPU can selectively reset
 the USB hub via a GPIO, so it would be better to remove the reset code.

 @Sean - can you please confirm/reject this finding?

@Sean: Do you have any comments on USB hub reset stuff? Should we ditch
entirely the reset code, or should we modify it somehow to work properly?


 +#define NOVENA_AUDIO_PWRONIMX_GPIO_NR(5, 17)
 ...
 +/*
 + * Audio
 + */
 +static iomux_v3_cfg_t audio_pads[] = {
 +/* AUD_PWRON */
 +MX6_PAD_DISP0_DAT23__GPIO5_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),
 +};

 The speaker amplifiers will still be disabled, as AUDIO_PWRON is not
 connected to them (R30A is marked as DNP). You need to add one more
 GPIO to enable the speaker amplifiers, here's the fix:

 #define NOVENA_AUDIO_PWRONIMX_GPIO_NR(5, 17)
 #define NOVENA_AUDIO_SPK_AMP_ONIMX_GPIO_NR(4, 9)

 /*
  * Audio
  */
 static iomux_v3_cfg_t audio_pads[] = {
 /* AUD_PWRON */
 MX6_PAD_KEY_ROW1__GPIO5_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),

 /* Speakers' amplifiers #SHDWN  */
 MX6_PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };

 static void novena_spl_setup_iomux_audio(void)
 {
 imx_iomux_v3_setup_multiple_pads(audio_pads, ARRAY_SIZE(audio_pads));

 gpio_direction_output(NOVENA_AUDIO_PWRON, 1);
 gpio_direction_output(NOVENA_AUDIO_SPK_AMP_ON, 1);
 }


 Side comment: If someone needs to talk to the Audio Codec via I2C3 in
 U-Boot environment, don't be surprised if the codec doesn't respond to
 any I2C requests at all (I've had such issues with SGTL5000). The most
 probable reason is that the codec doesn't receive reference clock from
 imx6 GPIO0. This is not a critical issues as later the kernel muxes
 this GPIO0 properly, but keep this in mind if you want to hack the
 audio-codec at low level.
 
 The audio codec ought to answer even when the reference clock isn't
 active.  I actually can't recall, but I think the digital side still
 works.

Well, that would be great if it works out this way. I just shared what
happened with another audio codec, to spare some frustration to others.


 The audio codec needs to be turned on because otherwise it will
 pull the SCL and SCK lines low, blocking I2C3 from working at all.

Agreed.


 Actually, now that I'm looking at it, we just had to make an ECO to get
 rid of SPK_AMP_ON.  It is now ganged to AUDIO_PWRON, because SPK_AMP_ON
 was accidentally dual-purposed as a GPIO for the front button on the
 desktop / laptop.  This change was made very recently (last Friday I
 think), and we'll be switching resistors on the mainboard when they're
 built in order to make the change.

Well, all I have is the Novena schematic 
(http://bunniefoo.com/novena/pvt2_release/novena_pvt2.PDF) so all my analysis 
is based on this PDF. On page 14, R30A is
DNP, and R28A is populated, this is why I suggested this modification to enable
speaker amps. If there are schematic changes, please publish the new version
so we can use the proper schematic and reduce spam.

@Marek: According to this latest update, there's no need for my fix for
NOVENA_AUDIO_SPK_AMP_ON, as your original code will work just fine with the
planned schematic changes. Please disregard the fix.

Kind regards,
Nikolay

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread Marek Vasut
On Wednesday, October 08, 2014 at 05:35:44 PM, picmas...@mail.bg wrote:
 Hi Sean,

Hi all,

 - Цитат от Sean Cross (x...@kosagi.com), на 08.10.2014 в 10:47 -
 
  On 08/10/2014 05:55, Nikolay Dimitrov wrote:
  Hi Marek,
  
  I'm marking only the critical issues that are left unfixed from
  previous conversations, to speed-up the process a little bit.
  I'll send later patches for the non-critical issues to spare you the
  extra work (and I'm sure my constructive criticism is already boring
  
  :D ).
  
  On 10/06/2014 07:02 PM, Marek Vasut wrote:
  +#define NOVENA_USB_HUB_RESETIMX_GPIO_NR(7, 12)
  
  ...
  
  +/*
  + * USB
  + */
  +#ifdef CONFIG_USB_EHCI_MX6
  +int board_ehci_hcd_init(int port)
  +{
  +/* Reset USB hub */
  +if (port == 1) {
  +gpio_set_value(NOVENA_USB_HUB_RESET, 0);
  +mdelay(2);
  +gpio_set_value(NOVENA_USB_HUB_RESET, 1);
  +}
  +return 0;
  +}
  +#endif
  
  As we previously discussed, this pin definition conflicts with
  NOVENA_PCIE_POWER_ON_GPIO (GPIO7_IO12 is connected to PCIE_PWRON), so
  by asserting it, you'll turn-off the wrong sub-system.
  
  Currently the USB hub is reset only by system reset (RESETBMCU
  asserted by the PMIC). I don't see how the CPU can selectively reset
  the USB hub via a GPIO, so it would be better to remove the reset code.
  
  @Sean - can you please confirm/reject this finding?
 
 @Sean: Do you have any comments on USB hub reset stuff? Should we ditch
 entirely the reset code, or should we modify it somehow to work properly?

OK, so it's just this USB that remains, right ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread Marek Vasut
On Tuesday, October 07, 2014 at 11:55:02 PM, Nikolay Dimitrov wrote:
 Hi Marek,
 
 I'm marking only the critical issues that are left unfixed from previous
 conversations, to speed-up the process a little bit.
 I'll send later patches for the non-critical issues to spare you the
 extra work (and I'm sure my constructive criticism is already boring :D ).

It's actually not, I like how multiple eyeballs on the code do spot these 
issues. On the other hand, I should have probably gone through the schematic
one more time and not base this whole thing only on the original code ;-)

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread Nikolay Dimitrov

Hi Marek,

On 10/09/2014 02:59 AM, Marek Vasut wrote:

On Wednesday, October 08, 2014 at 05:35:44 PM, picmas...@mail.bg wrote:

Hi Sean,


Hi all,


- Цитат от Sean Cross (x...@kosagi.com), на 08.10.2014 в 10:47 -


On 08/10/2014 05:55, Nikolay Dimitrov wrote:

Hi Marek,

I'm marking only the critical issues that are left unfixed from
previous conversations, to speed-up the process a little bit.
I'll send later patches for the non-critical issues to spare you the
extra work (and I'm sure my constructive criticism is already boring

:D ).

On 10/06/2014 07:02 PM, Marek Vasut wrote:

+#define NOVENA_USB_HUB_RESETIMX_GPIO_NR(7, 12)


...


+/*
+ * USB
+ */
+#ifdef CONFIG_USB_EHCI_MX6
+int board_ehci_hcd_init(int port)
+{
+/* Reset USB hub */
+if (port == 1) {
+gpio_set_value(NOVENA_USB_HUB_RESET, 0);
+mdelay(2);
+gpio_set_value(NOVENA_USB_HUB_RESET, 1);
+}
+return 0;
+}
+#endif


As we previously discussed, this pin definition conflicts with
NOVENA_PCIE_POWER_ON_GPIO (GPIO7_IO12 is connected to PCIE_PWRON), so
by asserting it, you'll turn-off the wrong sub-system.

Currently the USB hub is reset only by system reset (RESETBMCU
asserted by the PMIC). I don't see how the CPU can selectively reset
the USB hub via a GPIO, so it would be better to remove the reset code.

@Sean - can you please confirm/reject this finding?


@Sean: Do you have any comments on USB hub reset stuff? Should we ditch
entirely the reset code, or should we modify it somehow to work properly?


OK, so it's just this USB that remains, right ?


That's correct.

There are a bunch of non-critical things for fixing also, but we'll 
negotiate later about them :D.


Regards,
Nikolay
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread Marek Vasut
On Thursday, October 09, 2014 at 02:13:48 AM, Nikolay Dimitrov wrote:
 Hi Marek,

[...]

  @Sean: Do you have any comments on USB hub reset stuff? Should we ditch
  entirely the reset code, or should we modify it somehow to work
  properly?
  
  OK, so it's just this USB that remains, right ?
 
 That's correct.
 
 There are a bunch of non-critical things for fixing also, but we'll
 negotiate later about them :D.

Well what are those ?

Stefano, is there still any chance that a V6 of Novena would go into this 
release? I guess those chances are slim, right ?

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread Nikolay Dimitrov

Hi Marek,

On 10/09/2014 03:28 AM, Marek Vasut wrote:

On Thursday, October 09, 2014 at 02:13:48 AM, Nikolay Dimitrov wrote:

Hi Marek,


[...]


@Sean: Do you have any comments on USB hub reset stuff? Should we ditch
entirely the reset code, or should we modify it somehow to work
properly?


OK, so it's just this USB that remains, right ?


That's correct.

There are a bunch of non-critical things for fixing also, but we'll
negotiate later about them :D.


Well what are those ?


Stuff like removing GD memset from Novena code, as it's now handled by 
crt0.S, removing microSD CD pin definition as it's not used at all, 
improve PHY reset (both timing and signal conflicts), and about 5-6 
similar things which I can't remember, need to check again your patch.


As I said, I feel bad for torturing you anyway, and tried to think which 
are the critical things, which will break stuff if not fixed. The other 
fixes need another round of more discussions, so can be pushed later.


Regards,
Nikolay
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread Sean Cross
On 09/10/2014 07:59, Marek Vasut wrote:
 On Wednesday, October 08, 2014 at 05:35:44 PM, picmas...@mail.bg wrote:
 Hi Sean,
 Hi all,
Hello

 - Цитат от Sean Cross (x...@kosagi.com), на 08.10.2014 в 10:47 -

 On 08/10/2014 05:55, Nikolay Dimitrov wrote:
 Hi Marek,

 I'm marking only the critical issues that are left unfixed from
 previous conversations, to speed-up the process a little bit.
 I'll send later patches for the non-critical issues to spare you the
 extra work (and I'm sure my constructive criticism is already boring

 :D ).

 On 10/06/2014 07:02 PM, Marek Vasut wrote:
 +#define NOVENA_USB_HUB_RESETIMX_GPIO_NR(7, 12)
 ...

 +/*
 + * USB
 + */
 +#ifdef CONFIG_USB_EHCI_MX6
 +int board_ehci_hcd_init(int port)
 +{
 +/* Reset USB hub */
 +if (port == 1) {
 +gpio_set_value(NOVENA_USB_HUB_RESET, 0);
 +mdelay(2);
 +gpio_set_value(NOVENA_USB_HUB_RESET, 1);
 +}
 +return 0;
 +}
 +#endif
 As we previously discussed, this pin definition conflicts with
 NOVENA_PCIE_POWER_ON_GPIO (GPIO7_IO12 is connected to PCIE_PWRON), so
 by asserting it, you'll turn-off the wrong sub-system.

 Currently the USB hub is reset only by system reset (RESETBMCU
 asserted by the PMIC). I don't see how the CPU can selectively reset
 the USB hub via a GPIO, so it would be better to remove the reset code.

 @Sean - can you please confirm/reject this finding?
 @Sean: Do you have any comments on USB hub reset stuff? Should we ditch
 entirely the reset code, or should we modify it somehow to work properly?
 OK, so it's just this USB that remains, right ?

This is correct.  There is no GPIO-based way to reset the hub.


Sean
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-08 Thread Sean Cross
Hi Nikolay,

On 08/10/2014 23:35, picmas...@mail.bg wrote:
 Hi Sean,

 - Цитат от Sean Cross (x...@kosagi.com), на 08.10.2014 в 10:47 -

 On 08/10/2014 05:55, Nikolay Dimitrov wrote:
 Hi Marek,

 I'm marking only the critical issues that are left unfixed from
 previous conversations, to speed-up the process a little bit.
 I'll send later patches for the non-critical issues to spare you the
 extra work (and I'm sure my constructive criticism is already boring
 :D ).


 On 10/06/2014 07:02 PM, Marek Vasut wrote:
 +#define NOVENA_USB_HUB_RESETIMX_GPIO_NR(7, 12)
 ...
 +/*
 + * USB
 + */
 +#ifdef CONFIG_USB_EHCI_MX6
 +int board_ehci_hcd_init(int port)
 +{
 +/* Reset USB hub */
 +if (port == 1) {
 +gpio_set_value(NOVENA_USB_HUB_RESET, 0);
 +mdelay(2);
 +gpio_set_value(NOVENA_USB_HUB_RESET, 1);
 +}
 +return 0;
 +}
 +#endif
 As we previously discussed, this pin definition conflicts with
 NOVENA_PCIE_POWER_ON_GPIO (GPIO7_IO12 is connected to PCIE_PWRON), so
 by asserting it, you'll turn-off the wrong sub-system.

 Currently the USB hub is reset only by system reset (RESETBMCU
 asserted by the PMIC). I don't see how the CPU can selectively reset
 the USB hub via a GPIO, so it would be better to remove the reset code.

 @Sean - can you please confirm/reject this finding?
 @Sean: Do you have any comments on USB hub reset stuff? Should we ditch
 entirely the reset code, or should we modify it somehow to work properly?


 +#define NOVENA_AUDIO_PWRONIMX_GPIO_NR(5, 17)
 ...
 +/*
 + * Audio
 + */
 +static iomux_v3_cfg_t audio_pads[] = {
 +/* AUD_PWRON */
 +MX6_PAD_DISP0_DAT23__GPIO5_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),
 +};
 The speaker amplifiers will still be disabled, as AUDIO_PWRON is not
 connected to them (R30A is marked as DNP). You need to add one more
 GPIO to enable the speaker amplifiers, here's the fix:

 #define NOVENA_AUDIO_PWRONIMX_GPIO_NR(5, 17)
 #define NOVENA_AUDIO_SPK_AMP_ONIMX_GPIO_NR(4, 9)

 /*
  * Audio
  */
 static iomux_v3_cfg_t audio_pads[] = {
 /* AUD_PWRON */
 MX6_PAD_KEY_ROW1__GPIO5_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),

 /* Speakers' amplifiers #SHDWN  */
 MX6_PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };

 static void novena_spl_setup_iomux_audio(void)
 {
 imx_iomux_v3_setup_multiple_pads(audio_pads, ARRAY_SIZE(audio_pads));

 gpio_direction_output(NOVENA_AUDIO_PWRON, 1);
 gpio_direction_output(NOVENA_AUDIO_SPK_AMP_ON, 1);
 }


 Side comment: If someone needs to talk to the Audio Codec via I2C3 in
 U-Boot environment, don't be surprised if the codec doesn't respond to
 any I2C requests at all (I've had such issues with SGTL5000). The most
 probable reason is that the codec doesn't receive reference clock from
 imx6 GPIO0. This is not a critical issues as later the kernel muxes
 this GPIO0 properly, but keep this in mind if you want to hack the
 audio-codec at low level.
 The audio codec ought to answer even when the reference clock isn't
 active.  I actually can't recall, but I think the digital side still
 works.
 Well, that would be great if it works out this way. I just shared what
 happened with another audio codec, to spare some frustration to others.


 The audio codec needs to be turned on because otherwise it will
 pull the SCL and SCK lines low, blocking I2C3 from working at all.
 Agreed.


 Actually, now that I'm looking at it, we just had to make an ECO to get
 rid of SPK_AMP_ON.  It is now ganged to AUDIO_PWRON, because SPK_AMP_ON
 was accidentally dual-purposed as a GPIO for the front button on the
 desktop / laptop.  This change was made very recently (last Friday I
 think), and we'll be switching resistors on the mainboard when they're
 built in order to make the change.
 Well, all I have is the Novena schematic 
 (http://bunniefoo.com/novena/pvt2_release/novena_pvt2.PDF) so all my analysis 
 is based on this PDF. On page 14, R30A is
 DNP, and R28A is populated, this is why I suggested this modification to 
 enable
 speaker amps. If there are schematic changes, please publish the new version
 so we can use the proper schematic and reduce spam.

 @Marek: According to this latest update, there's no need for my fix for
 NOVENA_AUDIO_SPK_AMP_ON, as your original code will work just fine with the
 planned schematic changes. Please disregard the fix.

I'll be sure to have Bunnie post a new schematic when he returns
tomorrow.  For now, the ECO on our wiki is the authoritative source. 
This is curently the only ECO for the final PVT2 board:
http://www.kosagi.com/w/index.php?title=Novena_PVT2_ECO_List#ECO22:_swap_audio_control_option


Sean
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-07 Thread Sean Cross
On 07/10/2014 00:02, Marek Vasut wrote:
 Add support for the Kosagi Novena board. Currently supported are:
 - I2C busses
 - FEC Ethernet
 - MMC0, MMC1, Booting from MMC
 - SATA
 - USB ports
 - USB Ethernet

This patch looks good.  It resets the FPGA, muxes the correct UART
lines, and detects USB devices.  It doesn't have the newer FEC reset
sequence, but is the idea for Nikolay to submit that separately in order
to get credit for it?


Sean

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-07 Thread Marek Vasut
On Tuesday, October 07, 2014 at 11:52:33 AM, Sean Cross wrote:
 On 07/10/2014 00:02, Marek Vasut wrote:
  Add support for the Kosagi Novena board. Currently supported are:
  - I2C busses
  - FEC Ethernet
  - MMC0, MMC1, Booting from MMC
  - SATA
  - USB ports
  - USB Ethernet
 
 This patch looks good.  It resets the FPGA, muxes the correct UART
 lines, and detects USB devices.  It doesn't have the newer FEC reset
 sequence, but is the idea for Nikolay to submit that separately in order
 to get credit for it?

I would be happy to do it that way, what do you think ?

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] ARM: mx6: Add support for Kosagi Novena

2014-10-07 Thread Nikolay Dimitrov

Hi Marek,

I'm marking only the critical issues that are left unfixed from previous 
conversations, to speed-up the process a little bit.
I'll send later patches for the non-critical issues to spare you the 
extra work (and I'm sure my constructive criticism is already boring :D ).



On 10/06/2014 07:02 PM, Marek Vasut wrote:

+#define NOVENA_USB_HUB_RESET   IMX_GPIO_NR(7, 12)

...

+/*
+ * USB
+ */
+#ifdef CONFIG_USB_EHCI_MX6
+int board_ehci_hcd_init(int port)
+{
+   /* Reset USB hub */
+   if (port == 1) {
+   gpio_set_value(NOVENA_USB_HUB_RESET, 0);
+   mdelay(2);
+   gpio_set_value(NOVENA_USB_HUB_RESET, 1);
+   }
+   return 0;
+}
+#endif


As we previously discussed, this pin definition conflicts with 
NOVENA_PCIE_POWER_ON_GPIO (GPIO7_IO12 is connected to PCIE_PWRON), so by 
asserting it, you'll turn-off the wrong sub-system.


Currently the USB hub is reset only by system reset (RESETBMCU asserted 
by the PMIC). I don't see how the CPU can selectively reset the USB hub 
via a GPIO, so it would be better to remove the reset code.


@Sean - can you please confirm/reject this finding?



+#define NOVENA_AUDIO_PWRON IMX_GPIO_NR(5, 17)

...

+/*
+ * Audio
+ */
+static iomux_v3_cfg_t audio_pads[] = {
+   /* AUD_PWRON */
+   MX6_PAD_DISP0_DAT23__GPIO5_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),
+};


The speaker amplifiers will still be disabled, as AUDIO_PWRON is not 
connected to them (R30A is marked as DNP). You need to add one more GPIO 
to enable the speaker amplifiers, here's the fix:


#define NOVENA_AUDIO_PWRON  IMX_GPIO_NR(5, 17)
#define NOVENA_AUDIO_SPK_AMP_ON IMX_GPIO_NR(4, 9)

/*
 * Audio
 */
static iomux_v3_cfg_t audio_pads[] = {
/* AUD_PWRON */
MX6_PAD_KEY_ROW1__GPIO5_IO17 | MUX_PAD_CTRL(NO_PAD_CTRL),

/* Speakers' amplifiers #SHDWN  */
MX6_PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(NO_PAD_CTRL),
};

static void novena_spl_setup_iomux_audio(void)
{
imx_iomux_v3_setup_multiple_pads(audio_pads, ARRAY_SIZE(audio_pads));

gpio_direction_output(NOVENA_AUDIO_PWRON, 1);
gpio_direction_output(NOVENA_AUDIO_SPK_AMP_ON, 1);
}


Side comment: If someone needs to talk to the Audio Codec via I2C3 in 
U-Boot environment, don't be surprised if the codec doesn't respond to 
any I2C requests at all (I've had such issues with SGTL5000). The most 
probable reason is that the codec doesn't receive reference clock from 
imx6 GPIO0. This is not a critical issues as later the kernel muxes this 
GPIO0 properly, but keep this in mind if you want to hack the 
audio-codec at low level.



Reviewed-by: Nikolay Dimitrov picmas...@mail.bg


Kind regards,
Nikolay
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot