arm: mvf600: Add basic support for Vybrid MVF600TWR board
PATCH v3 6/6 arm: mvf600: Add basic support for Vybrid MVF600TWR board
Hi, Benoit,
Quoted 62 lines · Alison Wang
Quoted 7 lines
MVF600TWR is a board based on Vybrid MVF600 SoC.
This patch adds basic support for Vybrid MVF600TWR board.
Signed-off-by Alison Wang <[email protected]>Signed-off-by Jason Jin <[email protected]>Signed-off-by TsiChung Liew <[email protected]>[...]
Quoted 30 lines
board/freescale/mvf600twr/mvf600twr.c new file +23
-0@@ -0,0 +1,413 @@ +/* +* Copyright 2013 Freescale Semiconductor, Inc. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#include <common.h> +#include <asm/io.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/mvf_pins.h> board/freescale/mvf600twr/mvf600twr.c line 33
Quoted 10 lines
board/freescale/mvf600twr/mvf600twr.c new file +10
-0+#include <asm/arch/crm_regs.h> +#include <asm/arch/clock.h> +#include <mmc.h> +#include <fsl_esdhc.h> +#include <miiphy.h> +#include <netdev.h> + +DECLARE_GLOBAL_DATA_PTR ; + +#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED| \
board/freescale/mvf600twr/mvf600twr.c line 38
Quoted 5 lines
board/freescale/mvf600twr/mvf600twr.c new file +5
-0+ PAD_CTL_DSE_25ohm | PAD_CTL_OBE_IBE_ENABLE) + +#define ESDHC_PAD_CTRL (PAD_CTL_PUE | PAD_CTL_PUS_100K_UP | \ + PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_20ohm | \ + PAD_CTL_OBE_IBE_ENABLE)With the changes that I have suggested in my review of your IOMUX patch,
ESDHC_PAD_CTRLcould be simplified by removingPAD_CTL_PUE.
Quoted 4 lines
And without those changes,
UART_PAD_CTRLandENET_PAD_CTRLin your current code set pull values that are actually unused (unless the corresponding PKE/PUE bits do not exist and default to pull in the pad control registers used with these definitions).
[Alison Wang] Agree.
Quoted 13 lines
board/freescale/mvf600twr/mvf600twr.c line 40
Quoted 3 lines
board/freescale/mvf600twr/mvf600twr.c new file +2
-0+ +#define ENET_PAD_CTRL (PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_HIGH| \
board/freescale/mvf600twr/mvf600twr.c line 43
Quoted 3 lines
board/freescale/mvf600twr/mvf600twr.c new file +3
-0+ PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE) + +#define DDR_PAD_CTRL PAD_CTL_DSE_25ohm
MUX_PAD_CTRL()could be added to the 4 pad control definitions above in order to avoid repeating it everywhere below. But usingMUX_PAD_CTRL()relies on the fact that the pad control values inmvf_pins.hare all 0 (which is the case, but this is dangerous if this is changed later), so a better approach could be to useNEW_PAD_CTRL(), e.g.:
Quoted 5 lines
NEW_PAD_CTRL(MVF600_PAD_DDR_A15__DDR_A_15, DDR_PAD_CTRL), instead of: MVF600_PAD_DDR_A15__DDR_A_15 | MUX_PAD_CTRL(DDR_PAD_CTRL),Quoted 1 line
board/freescale/mvf600twr/mvf600twr.c new file +1
-0+
[Alison Wang] I have a question about using NEW_PAD_CTRL(). If NEW_PAD_CTRL() is used, should the pad control values for MVF600_PAD_DDR_A15__DDR_A_15 in mvf_pins.h be the same as DDR_PAD_CTRL? I saw you didn't use the same value on other platforms, how do you define it?
Best Regards,
Alison Wang
PATCH v3 6/6 arm: mvf600: Add basic support for Vybrid MVF600TWR board
Hi Alison,
On Wednesday, May 22, 2013 10:23:12 AM, Wang Huan-B18965 wrote:
[...]
Quoted 16 lines
Quoted 16 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +#define ENET_PAD_CTRL (PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_HIGH| \
Review
Quoted 3 lines
(quoted diff) +3
-0+ PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE) + +#define DDR_PAD_CTRL PAD_CTL_DSE_25ohm
MUX_PAD_CTRL()could be added to the 4 pad control definitions above in order to avoid repeating it everywhere below. But usingMUX_PAD_CTRL()relies on the fact that the pad control values inmvf_pins.hare all 0 (which is the case, but this is dangerous if this is changed later), so a better approach could be to useNEW_PAD_CTRL(), e.g.:NEW_PAD_CTRL(MVF600_PAD_DDR_A15__DDR_A_15, DDR_PAD_CTRL), instead of: MVF600_PAD_DDR_A15__DDR_A_15 | MUX_PAD_CTRL(DDR_PAD_CTRL),
Quoted 7 lines
Quoted 1 line
Quoted 1 line
+
[Alison Wang] I have a question about using
NEW_PAD_CTRL(). IfNEW_PAD_CTRL()is used, should the pad control values forMVF600_PAD_DDR_A15__DDR_A_15inmvf_pins.h
be the same asDDR_PAD_CTRL? I saw you didn't use the same value on other platforms,
how do you define it?
No, you don't have to change mvf_pins.h. That's what NEW_PAD_CTRL() is useful
for: You can have any pad control value defined in mvf_pins.h, and a board can override the pad control values when using definitions from mvf_pins.h, without having to modify mvf_pins.h.
E.g.:
---mvf_pins.h:MVF600_PAD_PTA6__RMII0_CLKIN = IOMUX_PAD(0x0, 0x0, 2, 0x0, 0, PAD_CTRL1),
mvf600twr.c:NEW_PAD_CTRL(MVF600_PAD_PTA6__RMII0_CLKIN, PAD_CTRL2),
---
would have the same effect as a theoretical:
---mvf_pins.h:MVF600_PAD_PTA6__RMII0_CLKIN = IOMUX_PAD(0x0, 0x0, 2, 0x0, 0, PAD_CTRL2),
mvf600twr.c:MVF600_PAD_PTA6__RMII0_CLKIN,
---
But if you think that the pad control values that you have defined in mvf600twr.c are not specific to this board and should be used as the default pad control values for all boards based on the MVF600, then you should move those definitions to mvf_pins.h, and use them there, which means that you will no longer need MUX_PAD_CTRL() or NEW_PAD_CTRL() in mvf600twr.c:
---mvf_pins.h:
#define MVF600_DDR_PAD_CTRL PAD_CTL_DSE_25ohm
...MVF600_PAD_DDR_A15__DDR_A_15 = IOMUX_PAD(0x0220, 0x0220, 0, 0x0000, 0,
MVF600_DDR_PAD_CTRL),
mvf600twr.c:MVF600_PAD_DDR_A15__DDR_A_15,
---
Best regards,
Beno?t
PATCH v3 6/6 arm: mvf600: Add basic support for Vybrid MVF600TWR board
Hi, Benoit,
Quoted 65 lines · On Wednesday, May 22, 2013 10:23:12 AM, Wang Huan-B18965 wrote:
[...]
Quoted 8 lines
Quoted 8 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +#define ENET_PAD_CTRL (PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_HIGH| \
Review
Quoted 3 lines
(quoted diff) +3
-0+ PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE) + +#define DDR_PAD_CTRL PAD_CTL_DSE_25ohm
MUX_PAD_CTRL()could be added to the 4 pad control definitionsabove
Quoted 4 lines
Quoted 4 lines
in order to avoid repeating it everywhere below. But using
MUX_PAD_CTRL()relies on the fact that the pad control values inmvf_pins.hare all 0 (which is the case, but this is dangerous if this is changed later), so a better approach could be to use
NEW_PAD_CTRL(), e.g.:Quoted 10 lines
Quoted 5 lines
NEW_PAD_CTRL(MVF600_PAD_DDR_A15__DDR_A_15, DDR_PAD_CTRL), instead of: MVF600_PAD_DDR_A15__DDR_A_15 | MUX_PAD_CTRL(DDR_PAD_CTRL),Quoted 1 line
+
[Alison Wang] I have a question about using
NEW_PAD_CTRL(). IfNEW_PAD_CTRL()is used, should the pad control values forMVF600_PAD_DDR_A15__DDR_A_15inmvf_pins.hbe the same asDDR_PAD_CTRL? I saw you didn't use the same value on other platforms, how do you define it?No, you don't have to change
mvf_pins.h. That's whatNEW_PAD_CTRL()is useful
for: You can have any pad control value defined inmvf_pins.h, and a board can override the pad control values when using definitions frommvf_pins.h, without having to modifymvf_pins.h.E.g.:
---mvf_pins.h:MVF600_PAD_PTA6__RMII0_CLKIN=IOMUX_PAD(0x0, 0x0, 2, 0x0, 0, PAD_CTRL1),
mvf600twr.c:NEW_PAD_CTRL(MVF600_PAD_PTA6__RMII0_CLKIN, PAD_CTRL2),
---
would have the same effect as a theoretical:
---mvf_pins.h:MVF600_PAD_PTA6__RMII0_CLKIN=IOMUX_PAD(0x0, 0x0, 2, 0x0, 0, PAD_CTRL2),
mvf600twr.c:MVF600_PAD_PTA6__RMII0_CLKIN,
---But if you think that the pad control values that you have defined in
mvf600twr.care not specific to this board and should be used as the default pad control values for all boards based on the MVF600, then you should move those definitions tomvf_pins.h, and use them there, which means that you will no longer needMUX_PAD_CTRL()orNEW_PAD_CTRL()inmvf600twr.c:
---mvf_pins.h:
#defineMVF600_DDR_PAD_CTRLPAD_CTL_DSE_25ohm
...MVF600_PAD_DDR_A15__DDR_A_15= IOMUX_PAD(0x0220,0x0220, 0,0x0000, 0,
Quoted 4 lines
MVF600_DDR_PAD_CTRL),
mvf600twr.c:MVF600_PAD_DDR_A15__DDR_A_15,
[Alison Wang] I see. Thanks.
Best Regards,
Alison Wang