net/fm: bug fix when CONFIG_PHYLIB not defined
Subsystems (7)
PATCH v2 4/16 net/fm: bug fix when CONFIG_PHYLIB not defined
From: Shaohui Xie <[email protected]>
phy_shutdown should be wrapped by CONFIG_PHYLIB.
--- drivers/net/fm/eth.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/fm/eth.c +2 -0
@@ -453,8 +453,10 @@ static void fm_eth_halt(struct eth_device *dev)/* disable bmi Rx port */ bmi_rx_port_disable (fm_eth->rx_port); +#ifdef CONFIG_PHYLIB if (fm_eth->phydev)phy_shutdown (fm_eth->phydev); +#endif }static int fm_eth_send (struct eth_device *dev,void *buf,int len)
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 5/16 net: Move some header files to include/
From: Shaohui Xie <[email protected]>
The fsl_dtsec.h & fsl_tgec.h & fsl_fman.h can be shared on both ARM and PPC, move it out of ppc to include/, and change the path in drivers accordingly.
--- arch/powerpc/include/asm/fsl_dtsec.h | 231 -------------- arch/powerpc/include/asm/fsl_fman.h | 463 ---------------------------- arch/powerpc/include/asm/fsl_tgec.h | 202 ------------ arch/powerpc/include/asm/immap_85xx.h | 2 +- board/freescale/b4860qds/eth_b4860qds.c | 2 +- board/freescale/corenet_ds/eth_hydra.c | 2 +- board/freescale/corenet_ds/eth_p4080.c | 2 +- board/freescale/corenet_ds/eth_superhydra.c | 2 +- board/freescale/p1023rdb/p1023rdb.c | 2 +- board/freescale/p2041rdb/eth.c | 2 +- board/freescale/t102xqds/eth_t102xqds.c | 2 +- board/freescale/t102xrdb/eth_t102xrdb.c | 2 +- board/freescale/t1040qds/eth.c | 2 +- board/freescale/t104xrdb/eth.c | 2 +- board/freescale/t208xqds/eth_t208xqds.c | 2 +- board/freescale/t208xrdb/eth_t208xrdb.c | 2 +- board/freescale/t4qds/eth.c | 2 +- board/freescale/t4rdb/eth.c | 2 +- drivers/net/fm/dtsec.c | 2 +- drivers/net/fm/eth.c | 18 +- drivers/net/fm/fm.h | 2 +- drivers/net/fm/tgec.c | 2 +- drivers/net/fm/tgec_phy.c | 2 +- include/fsl_dtsec.h | 231 ++++++++++++++ include/fsl_fman.h | 463 ++++++++++++++++++++++++++++ include/fsl_tgec.h | 202 ++++++++++++ 26 files changed, 924 insertions(+), 924 deletions(-)
arch/powerpc/include/asm/fsl_dtsec.h deleted +0 -231
@@ -1,231 +0,0 @@ -/* -* Copyright 2009-2011 Freescale Semiconductor, Inc. -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#ifndef __DTSEC_H__ -#define __DTSEC_H__ - -#include <asm/types.h> - -struct dtsec { -u32 tsec_id;/* controller ID and version */ -u32 tsec_id2;/* controller ID and configuration */ -u32 ievent;/* interrupt event */ -u32 imask;/* interrupt mask */ -u32 res0; -u32 ecntrl;/* ethernet control and configuration */ -u32 ptv;/* pause time value */ -u32 tbipa;/* TBI PHY address */ -u32 res1[8 ]; -u32 tctrl;/* Transmit control register */ -u32 res2[3 ]; -u32 rctrl;/* Receive control register */ -u32 res3[11 ]; -u32 igaddr[8 ];/* Individual group address */ -u32 gaddr[8 ];/* group address */ -u32 res4[16 ]; -u32 maccfg1;/* MAC configuration register 1 */ -u32 maccfg2;/* MAC configuration register 2 */ -u32 ipgifg;/* inter-packet/inter-frame gap */ -u32 hafdup;/* half-duplex control */ -u32 maxfrm;/* Maximum frame size */ -u32 res5[3 ]; -u32 miimcfg;/* MII management configuration */ -u32 miimcom;/* MII management command */ -u32 miimadd;/* MII management address */ -u32 miimcon;/* MII management control */ -u32 miimstat;/* MII management status */ -u32 miimind;/* MII management indicator */ -u32 res6; -u32 ifstat;/* Interface status */ -u32 macstnaddr1;/* MAC station address 1 */ -u32 macstnaddr2;/* MAC station address 2 */ -u32 res7[46 ]; -/* transmit and receive counter */ -u32 tr64;/* Tx and Rx 64 bytes frame */ -u32 tr127;/* Tx and Rx 65 to 127 bytes frame */ -u32 tr255;/* Tx and Rx 128 to 255 bytes frame */ -u32 tr511;/* Tx and Rx 256 to 511 bytes frame */ -u32 tr1k;/* Tx and Rx 512 to 1023 bytes frame */ -u32 trmax;/* Tx and Rx 1024 to 1518 bytes frame */ -u32 trmgv;/* Tx and Rx 1519 to 1522 good VLAN frame */ -/* receive counters */ -u32 rbyt;/* Receive byte counter */ -u32 rpkt;/* Receive packet counter */ -u32 rfcs;/* Receive FCS error */ -u32 rmca;/* Receive multicast packet */ -u32 rbca;/* Receive broadcast packet */ -u32 rxcf;/* Receive control frame */ -u32 rxpf;/* Receive pause frame */ -u32 rxuo;/* Receive unknown OP code */ -u32 raln;/* Receive alignment error */ -u32 rflr;/* Receive frame length error */ -u32 rcde;/* Receive code error */ -u32 rcse;/* Receive carrier sense error */ -u32 rund;/* Receive undersize packet */ -u32 rovr;/* Receive oversize packet */ -u32 rfrg;/* Receive fragments counter */ -u32 rjbr;/* Receive jabber counter */ -u32 rdrp;/* Receive drop counter */ -/* transmit counters */ -u32 tbyt;/* Transmit byte counter */ -u32 tpkt;/* Transmit packet */ -u32 tmca;/* Transmit multicast packet */ -u32 tbca;/* Transmit broadcast packet */ -u32 txpf;/* Transmit pause control frame */ -u32 tdfr;/* Transmit deferral packet */ -u32 tedf;/* Transmit excessive deferral pkt */ -u32 tscl;/* Transmit single collision pkt */ -u32 tmcl;/* Transmit multiple collision pkt */ -u32 tlcl;/* Transmit late collision pkt */ -u32 txcl;/* Transmit excessive collision */ -u32 tncl;/* Transmit total collision */ -u32 res8; -u32 tdrp;/* Transmit drop frame */ -u32 tjbr;/* Transmit jabber frame */ -u32 tfcs;/* Transmit FCS error */ -u32 txcf;/* Transmit control frame */ -u32 tovr;/* Transmit oversize frame */ -u32 tund;/* Transmit undersize frame */ -u32 tfrg;/* Transmit fragments frame */ -/* counter controls */ -u32 car1;/* carry register 1 */ -u32 car2;/* carry register 2 */ -u32 cam1;/* carry register 1 mask */ -u32 cam2;/* carry register 2 mask */ -u32 res9[80 ]; -}; - - -/* TBI register addresses */ -#define TBI_CR 0x00 -#define TBI_SR 0x01 -#define TBI_ANA 0x04 -#define TBI_ANLPBPA 0x05 -#define TBI_ANEX 0x06 -#define TBI_TBICON 0x11 - -/* TBI MDIO register bit fields*/ -#define TBICON_CLK_SELECT 0x0020 -#define TBIANA_ASYMMETRIC_PAUSE 0x0100 -#define TBIANA_SYMMETRIC_PAUSE 0x0080 -#define TBIANA_HALF_DUPLEX 0x0040 -#define TBIANA_FULL_DUPLEX 0x0020 -#define TBICR_PHY_RESET 0x8000 -#define TBICR_ANEG_ENABLE 0x1000 -#define TBICR_RESTART_ANEG 0x0200 -#define TBICR_FULL_DUPLEX 0x0100 -#define TBICR_SPEED1_SET 0x0040 - -/* IEVENT - interrupt events register */ -#define IEVENT_BABR 0x80000000/* Babbling receive error */ -#define IEVENT_RXC 0x40000000/* pause control frame received */ -#define IEVENT_MSRO 0x04000000/* MIB counter overflow */ -#define IEVENT_GTSC 0x02000000/* Graceful transmit stop complete */ -#define IEVENT_BABT 0x01000000/* Babbling transmit error */ -#define IEVENT_TXC 0x00800000/* control frame transmitted */ -#define IEVENT_TXE 0x00400000/* Transmit channel error */ -#define IEVENT_LC 0x00040000/* Late collision occurred */ -#define IEVENT_CRL 0x00020000/* Collision retry exceed limit */ -#define IEVENT_XFUN 0x00010000/* Transmit FIFO underrun */ -#define IEVENT_ABRT 0x00008000/* Transmit packet abort */ -#define IEVENT_MMRD 0x00000400/* MII management read complete */ -#define IEVENT_MMWR 0x00000200/* MII management write complete */ -#define IEVENT_GRSC 0x00000100/* Graceful stop complete */ -#define IEVENT_TDPE 0x00000002/* Internal data parity error on Tx */ -#define IEVENT_RDPE 0x00000001/* Internal data parity error on Rx */ - -#define IEVENT_CLEAR_ALL 0xffffffff - -/* IMASK - interrupt mask register */ -#define IMASK_BREN 0x80000000/* Babbling receive enable */ -#define IMASK_RXCEN 0x40000000/* receive control enable */ -#define IMASK_MSROEN 0x04000000/* MIB counter overflow enable */ -#define IMASK_GTSCEN 0x02000000/* Graceful Tx stop complete enable */ -#define IMASK_BTEN 0x01000000/* Babbling transmit error enable */ -#define IMASK_TXCEN 0x00800000/* control frame transmitted enable */ -#define IMASK_TXEEN 0x00400000/* Transmit channel error enable */ -#define IMASK_LCEN 0x00040000/* Late collision interrupt enable */ -#define IMASK_CRLEN 0x00020000/* Collision retry exceed limit */ -#define IMASK_XFUNEN 0x00010000/* Transmit FIFO underrun enable */ -#define IMASK_ABRTEN 0x00008000/* Transmit packet abort enable */ -#define IMASK_MMRDEN 0x00000400/* MII management read complete enable */ -#define IMASK_MMWREN 0x00000200/* MII management write complete enable */ -#define IMASK_GRSCEN 0x00000100/* Graceful stop complete interrupt enable */ -#define IMASK_TDPEEN 0x00000002/* Internal data parity error on Tx enable */ -#define IMASK_RDPEEN 0x00000001/* Internal data parity error on Rx enable */ - -#define IMASK_MASK_ALL 0x00000000 - -/* ECNTRL - ethernet control register */ -#define ECNTRL_CFG_RO 0x80000000/* GMIIM, RPM, R100M, SGMIIM bits are RO */ -#define ECNTRL_CLRCNT 0x00004000/* clear all statistics */ -#define ECNTRL_AUTOZ 0x00002000/* auto zero MIB counter */ -#define ECNTRL_STEN 0x00001000/* enable internal counters to update */ -#define ECNTRL_GMIIM 0x00000040/* 1- GMII or RGMII interface mode */ -#define ECNTRL_TBIM 0x00000020/* 1- Ten-bit interface mode */ -#define ECNTRL_RPM 0x00000010/* 1- RGMII reduced-pin mode */ -#define ECNTRL_R100M 0x00000008/* 1- RGMII 100 Mbps, SGMII 100 Mbps -0- RGMII 10 Mbps, SGMII 10 Mbps */ -#define ECNTRL_SGMIIM 0x00000002/* 1- SGMII interface mode */ -#define ECNTRL_TBIM 0x00000020/* 1- TBI Interface mode (for SGMII) */ - -#define ECNTRL_DEFAULT (ECNTRL_TBIM | ECNTRL_R100M | ECNTRL_SGMIIM) - -/* TCTRL - Transmit control register */ -#define TCTRL_THDF 0x00000800/* Transmit half-duplex flow control */ -#define TCTRL_TTSE 0x00000040/* Transmit time-stamp enable */ -#define TCTRL_GTS 0x00000020/* Graceful transmit stop */ -#define TCTRL_RFC_PAUSE 0x00000010/* Receive flow control pause frame */ - -/* RCTRL - Receive control register */ -#define RCTRL_PAL_MASK 0x001f0000/* packet alignment padding length */ -#define RCTRL_PAL_SHIFT 16 -#define RCTRL_CFA 0x00008000/* control frame accept enable */ -#define RCTRL_GHTX 0x00000800/* group address hash table extend */ -#define RCTRL_RTSE 0x00000040/* receive 1588 time-stamp enable */ -#define RCTRL_GRS 0x00000020/* graceful receive stop */ -#define RCTRL_BC_REJ 0x00000010/* broadcast frame reject */ -#define RCTRL_BC_MPROM 0x00000008/* all multicast/broadcast frames received */ -#define RCTRL_RSF 0x00000004/* receive short frame(17~63 bytes) enable */ -#define RCTRL_EMEN 0x00000002/* Exact match MAC address enable */ -#define RCTRL_UPROM 0x00000001/* all unicast frame received */ - -/* MACCFG1 - MAC configuration 1 register */ -#define MACCFG1_SOFT_RST 0x80000000/* place the MAC in reset */ -#define MACCFG1_RST_RXMAC 0x00080000/* reset receive MAC control block */ -#define MACCFG1_RST_TXMAC 0x00040000/* reet transmit MAC control block */ -#define MACCFG1_RST_RXFUN 0x00020000/* reset receive function block */ -#define MACCFG1_RST_TXFUN 0x00010000/* reset transmit function block */ -#define MACCFG1_LOOPBACK 0x00000100/* MAC loopback */ -#define MACCFG1_RX_FLOW 0x00000020/* Receive flow */ -#define MACCFG1_TX_FLOW 0x00000010/* Transmit flow */ -#define MACCFG1_SYNC_RXEN 0x00000008/* Frame reception enabled */ -#define MACCFG1_RX_EN 0x00000004/* Rx enable */ -#define MACCFG1_SYNC_TXEN 0x00000002/* Frame transmission is enabled */ -#define MACCFG1_TX_EN 0x00000001/* Tx enable */ -#define MACCFG1_RXTX_EN (MACCFG1_RX_EN | MACCFG1_TX_EN) - -/* MACCFG2 - MAC configuration 2 register */ -#define MACCFG2_PRE_LEN_MASK 0x0000f000/* preamble length */ -#define MACCFG2_PRE_LEN (x) ((x << 12) & MACCFG2_PRE_LEN_MASK) -#define MACCFG2_IF_MODE_MASK 0x00000300 -#define MACCFG2_IF_MODE_NIBBLE 0x00000100/* MII, 10/100 Mbps MII/RMII */ -#define MACCFG2_IF_MODE_BYTE 0x00000200/* GMII/TBI, 1000 GMII/TBI */ -#define MACCFG2_PRE_RX_EN 0x00000080/* receive preamble enable */ -#define MACCFG2_PRE_TX_EN 0x00000040/* tx preable enable */ -#define MACCFG2_HUGE_FRAME 0x00000020/* >= max frame len enable */ -#define MACCFG2_LEN_CHECK 0x00000010/* MAC check frame's length Rx */ -#define MACCFG2_MAG_EN 0x00000008/* magic packet enable */ -#define MACCFG2_PAD_CRC 0x00000004/* pad and append CRC */ -#define MACCFG2_CRC_EN 0x00000002/* MAC appends a CRC on all frames */ -#define MACCFG2_FULL_DUPLEX 0x00000001/* Full deplex mode */ - -struct fsl_enet_mac ; - -void init_dtsec (struct fsl_enet_mac *mac,void *base,void *phyregs, -int max_rx_len); - -#endif
arch/powerpc/include/asm/fsl_fman.h deleted +0 -463
463 lines not on this page · raw message
arch/powerpc/include/asm/fsl_tgec.h deleted +0 -202
202 lines not on this page · raw message
arch/powerpc/include/asm/immap_85xx.h +1 -1
@@ -19,7 +19,7 @@#include <fsl_sec.h> #include <fsl_sfp.h> #include <asm/fsl_lbc.h> -#include <asm/fsl_fman.h> +#include <fsl_fman.h> #include <fsl_immap.h> typedef struct ccsr_local {
board/freescale/b4860qds/eth_b4860qds.c +1 -1
@@ -26,7 +26,7 @@#include <fsl_mdio.h> #include <malloc.h> #include <fdt_support.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include "../common/ngpixis.h" #include "../common/fman.h"
board/freescale/corenet_ds/eth_hydra.c +1 -1
@@ -55,7 +55,7 @@#include <fsl_mdio.h> #include <malloc.h> #include <fdt_support.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include "../common/ngpixis.h" #include "../common/fman.h"
board/freescale/corenet_ds/eth_p4080.c +1 -1
@@ -24,7 +24,7 @@#include "../common/ngpixis.h" #include "../common/fman.h" -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #define EMI_NONE 0xffffffff#define EMI_MASK 0xf0000000
board/freescale/corenet_ds/eth_superhydra.c +1 -1
@@ -55,7 +55,7 @@#include <fsl_mdio.h> #include <malloc.h> #include <fdt_support.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include "../common/ngpixis.h" #include "../common/fman.h"
board/freescale/p1023rdb/p1023rdb.c +1 -1
@@ -26,7 +26,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> DECLARE_GLOBAL_DATA_PTR ;
board/freescale/p2041rdb/eth.c +1 -1
@@ -19,7 +19,7 @@#include <fm_eth.h> #include <fsl_mdio.h> #include <malloc.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include "cpld.h" #include "../common/fman.h"
board/freescale/t102xqds/eth_t102xqds.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include "../common/qixis.h" #include "../common/fman.h"
board/freescale/t102xrdb/eth_t102xrdb.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include "../common/fman.h"
board/freescale/t1040qds/eth.c +1 -1
@@ -17,7 +17,7 @@#include <fm_eth.h> #include <fsl_mdio.h> #include <malloc.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <vsc9953.h> #include "../common/fman.h"
board/freescale/t104xrdb/eth.c +1 -1
@@ -11,7 +11,7 @@#include <fm_eth.h> #include <fsl_mdio.h> #include <malloc.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <vsc9953.h> #include "../common/fman.h"
board/freescale/t208xqds/eth_t208xqds.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include <hwconfig.h> #include "../common/qixis.h"
board/freescale/t208xrdb/eth_t208xrdb.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> int board_eth_init (bd_t *bis)
board/freescale/t4qds/eth.c +1 -1
@@ -21,7 +21,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include <hwconfig.h> #include "../common/qixis.h"
board/freescale/t4rdb/eth.c +1 -1
@@ -23,7 +23,7 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <asm/fsl_serdes.h> #include <hwconfig.h>
drivers/net/fm/dtsec.c +1 -1
@@ -7,7 +7,7 @@#include <common.h> #include <asm/types.h> #include <asm/io.h> -#include <asm/fsl_dtsec.h> +#include <fsl_dtsec.h> #include <fsl_mdio.h> #include <phy.h>
drivers/net/fm/eth.c +9 -9
@@ -13,8 +13,8 @@#include <fsl_mdio.h> #include <miiphy.h> #include <phy.h> -#include <asm/fsl_dtsec.h> -#include <asm/fsl_tgec.h> +#include <fsl_dtsec.h> +#include <fsl_tgec.h> #include <fsl_memac.h> #include "fm.h"
@@ -370,7 +370,7 @@ static void fmc_tx_port_graceful_stop_enable(struct fm_eth *fm_eth) pram = fm_eth->tx_pram;/* graceful stop transmission of frames */ setbits_be32 (&pram->mode,PRAM_MODE_GRACEFUL_STOP ); -sync (); +mb (); }static void fmc_tx_port_graceful_stop_disable (struct fm_eth *fm_eth)
@@ -380,7 +380,7 @@ static void fmc_tx_port_graceful_stop_disable(struct fm_eth *fm_eth) pram = fm_eth->tx_pram;/* re-enable transmission of frames */ clrbits_be32 (&pram->mode,PRAM_MODE_GRACEFUL_STOP ); -sync (); +mb (); }static int fm_eth_open (struct eth_device *dev,bd_t *bd)
@@ -484,9 +484,9 @@ static int fm_eth_send(struct eth_device *dev, void *buf, int len)muram_writew (&txbd->buf_ptr_hi,0 );out_be32 (&txbd->buf_ptr_lo, (u32 )buf);muram_writew (&txbd->len, len); -sync (); +mb ();muram_writew (&txbd->status, TxBD_READY | TxBD_LAST); -sync (); +mb ();/* update TxQD, let RISC to send the packet */ offset_in =muram_readw (&pram->txqd.offset_in);
@@ -494,7 +494,7 @@ static int fm_eth_send(struct eth_device *dev, void *buf, int len)if (offset_in >=muram_readw (&pram->txqd.bd_ring_size)) offset_in =0 ;muram_writew (&pram->txqd.offset_in, offset_in); -sync (); +mb ();/* wait for buffer to be transmitted */ for (i =0 ;muram_readw (&txbd->status) & TxBD_READY; i++) {
@@ -545,7 +545,7 @@ static int fm_eth_recv(struct eth_device *dev)/* clear the RxBDs */ muram_writew (&rxbd->status, RxBD_EMPTY);muram_writew (&rxbd->len,0 ); -sync (); +mb ();/* advance RxBD */ rxbd++;
@@ -561,7 +561,7 @@ static int fm_eth_recv(struct eth_device *dev)if (offset_out >=muram_readw (&pram->rxqd.bd_ring_size)) offset_out =0 ;muram_writew (&pram->rxqd.offset_out, offset_out); -sync (); +mb (); } fm_eth->cur_rxbd = (void *)rxbd;
drivers/net/fm/fm.h +1 -1
@@ -10,7 +10,7 @@#include <common.h> #include <phy.h> #include <fm_eth.h> -#include <asm/fsl_fman.h> +#include <fsl_fman.h> /* Port ID */ #define OH_PORT_ID_BASE 0x01
drivers/net/fm/tgec.c +1 -1
@@ -12,7 +12,7 @@#include <phy.h> #include <asm/types.h> #include <asm/io.h> -#include <asm/fsl_tgec.h> +#include <fsl_tgec.h> #include "fm.h"
drivers/net/fm/tgec_phy.c +1 -1
@@ -9,7 +9,7 @@#include <miiphy.h> #include <phy.h> #include <asm/io.h> -#include <asm/fsl_tgec.h> +#include <fsl_tgec.h> #include <fm_eth.h> /*
include/fsl_dtsec.h new file +231 -0
231 lines not on this page · raw message
include/fsl_fman.h new file +463 -0
463 lines not on this page · raw message
include/fsl_tgec.h new file +202 -0
202 lines not on this page · raw message
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 5/16 net: Move some header files to include/
Quoted 8 lines · Gong Qianyu
From: Shaohui Xie <[email protected]>
The
fsl_dtsec.h&fsl_tgec.h&fsl_fman.hcan be shared on both ARM and PPC, move it out of ppc toinclude/, and change the path in drivers accordingly.Signed-off-by Shaohui Xie <[email protected]>Signed-off-by Gong Qianyu <[email protected]>
Pass -M -C to git format-patch.
-Scott
PATCH v2 6/16 net/fm: Add QSGMII PCS init
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
QSGMII PCS needed to be programmed same as SGMII PCS, and there are four ports in QSGMII PCS, port 0, 1, 2, 3, all the four ports shared port 0's MDIO controller, so when programming port 0, we continue to program other three ports.
--- drivers/net/fm/eth.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
drivers/net/fm/eth.c +17 -5
@@ -41,28 +41,39 @@ static void dtsec_configure_serdes(struct fm_eth *priv) bus.priv = priv->mac->phyregs;bool sgmii_2500 = (priv->enet_if ==PHY_INTERFACE_MODE_SGMII_2500 ) ? true : false; +int i =0 ; + +qsgmii_loop: +if ((priv->enet_if ==PHY_INTERFACE_MODE_QSGMII ) && + ((priv->phyaddr %4 ) !=0 )) +return ;/* SGMII IF mode + AN enable only for 1G SGMII, not for 2.5G */ value =PHY_SGMII_IF_MODE_SGMII ;if (!sgmii_2500) value |=PHY_SGMII_IF_MODE_AN ; -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0x14 , value); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0x14 , value);/* Dev ability according to SGMII specification */ value =PHY_SGMII_DEV_ABILITY_SGMII ; -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0x4 , value); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0x4 , value);/* Adjust link timer for SGMII - 1.6 ms in units of 8 ns = 2 * 10^5 = 0x30d40 */ -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0x13 ,0x3 ); -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0x12 ,0xd40 ); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0x13 ,0x3 ); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0x12 ,0xd40 );/* Restart AN */ value =PHY_SGMII_CR_DEF_VAL ;if (!sgmii_2500) value |=PHY_SGMII_CR_RESET_AN ; -memac_mdio_write (&bus,0 ,MDIO_DEVAD_NONE ,0 , value); +memac_mdio_write (&bus, i,MDIO_DEVAD_NONE ,0 , value); + +if ((priv->enet_if ==PHY_INTERFACE_MODE_QSGMII ) && (i <3 )) { + i++; + goto qsgmii_loop; + }#else struct dtsec *regs = priv->mac->base;struct tsec_mii_mng *phyregs = priv->mac->phyregs;
@@ -91,6 +102,7 @@ static void dtsec_init_phy(struct eth_device *dev)#endif if (fm_eth->enet_if ==PHY_INTERFACE_MODE_SGMII || + fm_eth->enet_if ==PHY_INTERFACE_MODE_QSGMII || fm_eth->enet_if ==PHY_INTERFACE_MODE_SGMII_2500 )dtsec_configure_serdes (fm_eth); }
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 7/16 net/fm: fix MDIO controller base on FMAN2
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
MDIO controller base on FMAN2 was defined as CONFIG_SYS_FSL_FM2_ADDR plus offset, but CONFIG_SYS_FSL_FM2_ADDR only defined when there are two FMANs, so we should only define MDIO controller base on FMAN2 when there is FMAN2.
--- include/fm_eth.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
include/fm_eth.h +17 -0
@@ -45,8 +45,10 @@ enum fm_eth_type {#ifdef CONFIG_SYS_FMAN_V3 #define CONFIG_SYS_FM1_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xfc000)#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xfd000) +#if (CONFIG_SYS_NUM_FMAN ==2 )#define CONFIG_SYS_FM2_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR + 0xfc000)#define CONFIG_SYS_FM2_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR + 0xfd000) +#endif #else #define CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xe1120)#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xf1000)
@@ -89,6 +91,7 @@ enum fm_eth_type { offsetof(struct ccsr_fman, memac[n-1]),\ }#else +#if (CONFIG_SYS_NUM_FMAN ==2 )#define FM_TGEC_INFO_INITIALIZER (idx, n) \ { \ FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM2_TGEC_MDIO_ADDR) \
@@ -101,6 +104,20 @@ enum fm_eth_type { .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ offsetof(struct ccsr_fman, memac[n-1+8]),\ } +#else +#define FM_TGEC_INFO_INITIALIZER (idx, n) \ +{ \ + FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM1_TGEC_MDIO_ADDR) \ + .index = idx, \ + .num = n - 1, \ + .type = FM_ETH_10G_E, \ + .port = FM##idx##_10GEC##n, \ + .rx_port_id = RX_PORT_10G_BASE + n - 1, \ + .tx_port_id = TX_PORT_10G_BASE + n - 1, \ + .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ + offsetof(struct ccsr_fman, memac[n-1+8]),\ +} +#endif #endif #if (CONFIG_SYS_NUM_FM1_10GEC >=3 )
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 7/16 net/fm: fix MDIO controller base on FMAN2
Quoted 46 lines · Gong Qianyu
From: Shaohui Xie <[email protected]>
MDIO controller base on FMAN2 was defined as
CONFIG_SYS_FSL_FM2_ADDRplus offset, butCONFIG_SYS_FSL_FM2_ADDRonly defined when there are two FMANs, so we should only define MDIO controller base on FMAN2 when there is FMAN2.Signed-off-by Shaohui Xie <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>--- include/fm_eth.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)include/fm_eth.h +8
-0@@ -45,8 +45,10 @@ enum fm_eth_type {#ifdef CONFIG_SYS_FMAN_V3 #define CONFIG_SYS_FM1_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xfc000)#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xfd000) +#if (CONFIG_SYS_NUM_FMAN ==2 )#define CONFIG_SYS_FM2_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR + 0xfc000)#define CONFIG_SYS_FM2_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR + 0xfd000) +#endif #else #define CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xe1120)#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR + 0xf1000)@@ -89,6 +91,7 @@ enum fm_eth_type { offsetof(struct ccsr_fman, memac[n-1]),\ }#else +#if (CONFIG_SYS_NUM_FMAN ==2 )#define FM_TGEC_INFO_INITIALIZER (idx, n) \ { \ FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM2_TGEC_MDIO_ADDR) \@@ -101,6 +104,20 @@ enum fm_eth_type { .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ offsetof(struct ccsr_fman, memac[n-1+8]),\ } +#else +#define FM_TGEC_INFO_INITIALIZER (idx, n) \ +{ \ + FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM1_TGEC_MDIO_ADDR) \ + .index = idx, \
include/fm_eth.h enum fm_eth_type { · line 121
Quoted 10 lines
include/fm_eth.h +9
-0+ .num = n - 1, \ + .type = FM_ETH_10G_E, \ + .port = FM##idx##_10GEC##n, \ + .rx_port_id = RX_PORT_10G_BASE + n - 1, \ + .tx_port_id = TX_PORT_10G_BASE + n - 1, \ + .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ + offsetof(struct ccsr_fman, memac[n-1+8]),\ +} +#endif #endif
doc/README.fsl-dpaa says that CONFIG_FSL_FM_10GEC_REGULAR_NOTATION is for newer SoCs. Presumably this patch is for ls1043a -- is that not considered a newer SoC? Or does the README need to be fixed?
-Scott
PATCH v2 7/16 net/fm: fix MDIO controller base on FMAN2
Quoted 66 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: Friday, September 18, 2015 2:05 AM
To: Gong Qianyu-B52263
Cc: u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin-B53747; Xie Shaohui-B21989; Wood Scott- B07421
Subject: Re: [Patch v2 07/16] net/fm: fix MDIO controller base on FMAN2Quoted 19 lines · Gong Qianyu
From: Shaohui Xie <[email protected]>
MDIO controller base on FMAN2 was defined as
CONFIG_SYS_FSL_FM2_ADDRplus offset, butCONFIG_SYS_FSL_FM2_ADDRonly defined when there are two FMANs, so we should only define MDIO controller base on FMAN2 when there is FMAN2.Signed-off-by Shaohui Xie <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>--- include/fm_eth.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)include/fm_eth.h index renamed from include/fm_eth.h +0
-03e1b9f4..d43f801 100644
include/fm_eth.h enum fm_eth_type { · line 46
Quoted 2 lines
include/fm_eth.h +0
-0@@ -45,8 +45,10 @@ enum fm_eth_type {#ifdef CONFIG_SYS_FMAN_V3 #define CONFIG_SYS_FM1_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR+
0xfc000)include/fm_eth.h enum fm_eth_type { · line 47
Quoted 1 line
include/fm_eth.h +0
-0#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR+
0xfd000)include/fm_eth.h enum fm_eth_type { · line 49
Quoted 2 lines
include/fm_eth.h +1
-0+#if (CONFIG_SYS_NUM_FMAN ==2 )#define CONFIG_SYS_FM2_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR+
0xfc000)include/fm_eth.h enum fm_eth_type { · line 50
Quoted 1 line
include/fm_eth.h +0
-0#define CONFIG_SYS_FM2_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR+
0xfd000)include/fm_eth.h enum fm_eth_type {
Quoted 3 lines
include/fm_eth.h +1
-0+#endif #else #define CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR+
0xe1120)include/fm_eth.h enum fm_eth_type { · line 54
Quoted 1 line
include/fm_eth.h +0
-0#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR+
0xf1000)Quoted 21 lines
include/fm_eth.h +0
-0@@ -89,6 +91,7 @@ enum fm_eth_type { offsetof(struct ccsr_fman,memac[n-1]),\ } #else
+#if (CONFIG_SYS_NUM_FMAN== 2)
#defineFM_TGEC_INFO_INITIALIZER(idx, n)\{ \ FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM2_TGEC_MDIO_ADDR) \include/fm_eth.h +10
-0@@ -101,6 +104,20 @@ enum fm_eth_type { .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ offsetof(struct ccsr_fman, memac[n-1+8]),\ } +#else +#define FM_TGEC_INFO_INITIALIZER (idx, n) \ +{ \ + FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM1_TGEC_MDIO_ADDR) \ + .index = idx, \ + .num = n - 1, \ + .type = FM_ETH_10G_E, \ + .port = FM##idx##_10GEC##n, \ + .rx_port_id = RX_PORT_10G_BASE + n - 1, \ + .tx_port_id = TX_PORT_10G_BASE + n - 1, \
Quoted 8 lines
include/fm_eth.h enum fm_eth_type { · line 121
Quoted 4 lines
include/fm_eth.h +3
-0+ .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ + offsetof(struct ccsr_fman, +memac[n-1+8]),\ } #endif#endif doc/README.fsl-dpaa says that
CONFIG_FSL_FM_10GEC_REGULAR_NOTATIONis for newer SoCs. Presumably this patch is for ls1043a -- is that not considered a newer SoC? Or does the README need to be fixed?
[S.H] Yes, this is for LS1043A. LS1043A has one FMAN same as T2080. A new SoC but has an old DPAA.
The issue this patch intends to fix is there is only one FMAN on LS1043A, So CONFIG_SYS_FSL_FM2_ADDR is not defined on LS1043A, the define of MDIO controller base On FMAN2 uses CONFIG_SYS_FSL_FM2_ADDR caused error on LS1043A.
Thanks!
Shaohui
PATCH v2 7/16 net/fm: fix MDIO controller base on FMAN2
Quoted 74 lines · On Thu, 2015-09-17 at 22:49 -0500, Xie Shaohui-B21989 wrote:
Quoted 66 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: Friday, September 18, 2015 2:05 AM
To: Gong Qianyu-B52263
Cc: u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin-B53747; Xie Shaohui-B21989; Wood Scott- B07421
Subject: Re: [Patch v2 07/16] net/fm: fix MDIO controller base on FMAN2Quoted 19 lines · Gong Qianyu
From: Shaohui Xie <[email protected]>
MDIO controller base on FMAN2 was defined as
CONFIG_SYS_FSL_FM2_ADDRplus offset, butCONFIG_SYS_FSL_FM2_ADDRonly defined when there are two FMANs, so we should only define MDIO controller base on FMAN2 when there is FMAN2.Signed-off-by Shaohui Xie <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>--- include/fm_eth.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)include/fm_eth.h index renamed from include/fm_eth.h +0
-03e1b9f4..d43f801 100644
include/fm_eth.h enum fm_eth_type { · line 46
Quoted 2 lines
include/fm_eth.h +0
-0@@ -45,8 +45,10 @@ enum fm_eth_type {#ifdef CONFIG_SYS_FMAN_V3 #define CONFIG_SYS_FM1_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR+
0xfc000)include/fm_eth.h enum fm_eth_type { · line 47
Quoted 1 line
include/fm_eth.h +0
-0#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR+
0xfd000)include/fm_eth.h enum fm_eth_type { · line 49
Quoted 2 lines
include/fm_eth.h +1
-0+#if (CONFIG_SYS_NUM_FMAN ==2 )#define CONFIG_SYS_FM2_DTSEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR+
0xfc000)include/fm_eth.h enum fm_eth_type { · line 50
Quoted 1 line
include/fm_eth.h +0
-0#define CONFIG_SYS_FM2_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM2_ADDR+
0xfd000)include/fm_eth.h enum fm_eth_type {
Quoted 3 lines
include/fm_eth.h +1
-0+#endif #else #define CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR+
0xe1120)include/fm_eth.h enum fm_eth_type { · line 54
Quoted 1 line
include/fm_eth.h +0
-0#define CONFIG_SYS_FM1_TGEC_MDIO_ADDR (CONFIG_SYS_FSL_FM1_ADDR+
0xf1000)Quoted 21 lines
include/fm_eth.h +0
-0@@ -89,6 +91,7 @@ enum fm_eth_type { offsetof(struct ccsr_fman,memac[n-1]),\ } #else
+#if (CONFIG_SYS_NUM_FMAN== 2)
#defineFM_TGEC_INFO_INITIALIZER(idx, n)\{ \ FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM2_TGEC_MDIO_ADDR) \include/fm_eth.h +10
-0@@ -101,6 +104,20 @@ enum fm_eth_type { .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ offsetof(struct ccsr_fman, memac[n-1+8]),\ } +#else +#define FM_TGEC_INFO_INITIALIZER (idx, n) \ +{ \ + FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM1_TGEC_MDIO_ADDR) \ + .index = idx, \ + .num = n - 1, \ + .type = FM_ETH_10G_E, \ + .port = FM##idx##_10GEC##n, \ + .rx_port_id = RX_PORT_10G_BASE + n - 1, \ + .tx_port_id = TX_PORT_10G_BASE + n - 1, \Quoted 8 lines
include/fm_eth.h enum fm_eth_type { · line 121
Quoted 4 lines
include/fm_eth.h +3
-0+ .compat_offset = CONFIG_SYS_FSL_FM##idx##_OFFSET + \ + offsetof(struct ccsr_fman, +memac[n-1+8]),\ } #endif#endif doc/README.fsl-dpaa says that
CONFIG_FSL_FM_10GEC_REGULAR_NOTATIONis for newer SoCs. Presumably this patch is for ls1043a -- is that not considered a newer SoC? Or does the README need to be fixed?
Quoted 2 lines
[S.H] Yes, this is for LS1043A. LS1043A has one FMAN same as T2080. A new SoC but has an old DPAA.
So maybe the README should be changed to more accurately talk about FMan versions?
-Scott
PATCH v2 7/16 net/fm: fix MDIO controller base on FMAN2
Quoted 10 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: Friday, September 18, 2015 1:13 PM
To: Xie Shaohui-B21989
Cc: Gong Qianyu-B52263; u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin-B53747
Subject: Re: [Patch v2 07/16] net/fm: fix MDIO controller base on FMAN2
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
doc/README.fsl-dpaa says that
CONFIG_FSL_FM_10GEC_REGULAR_NOTATIONis for newer SoCs. Presumably this patch is for ls1043a -- is that not considered a newer SoC? Or does the README need to be fixed?[S.H] Yes, this is for LS1043A. LS1043A has one FMAN same as T2080. A new SoC but has an old DPAA.
So maybe the README should be changed to more accurately talk about FMan versions?
Thanks, we will change the README to make it clear.
Thanks,
Mingkai
PATCH v2 8/16 net/fm: fix compile warnings for 64-bit platform
In reply to Gong QianyuThis patch fixes such compile warnings:
drivers/net/fm/eth.c: In function 'fm_eth_recv':drivers/net/fm/eth.c:549:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
data = (u8 *)in_be32(&rxbd->buf_ptr_lo); drivers/net/fm/fm.c: In function 'fm_muram_alloc': drivers/net/fm/fm.c:52:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memset((void *)ret, 0, size); drivers/net/fm/fm.c: In function 'fm_init_muram': drivers/net/fm/fm.c:59:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] u32 base = (u32)reg;
Just make the cast explicit for them.
--- drivers/net/fm/eth.c | 31 ++++++++++++++++--------------- drivers/net/fm/fm.c | 4 ++-- 2 files changed, 18 insertions(+), 17 deletions(-)
drivers/net/fm/eth.c +16 -15
@@ -120,12 +120,12 @@ static int tgec_is_fibre(struct eth_device *dev)static u16 muram_readw (u16 *addr) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;u32 val32 =in_be32 ((u32 *)base);int byte_pos;u16 ret; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) ret = (u16)(val32 &0x0000ffff );else
@@ -136,12 +136,12 @@ static u16 muram_readw(u16 *addr)static void muram_writew (u16 *addr,u16 val) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;u32 org32 =in_be32 ((u32 *)base);u32 val32;int byte_pos; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) val32 = (org32 &0xffff0000 ) | val;else
@@ -217,12 +217,12 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)int i;/* alloc global parameter ram at MURAM */ - pram = (struct fm_port_global_pram *)fm_muram_alloc (fm_eth->fm_index, -FM_PRAM_SIZE ,FM_PRAM_ALIGN ); + pram = (struct fm_port_global_pram *)(ulong )fm_muram_alloc ( + fm_eth->fm_index,FM_PRAM_SIZE ,FM_PRAM_ALIGN ); fm_eth->rx_pram = pram;/* parameter page offset to MURAM */ - pram_page_offset = (u32 )pram -fm_muram_base (fm_eth->fm_index); + pram_page_offset = (u32 )(ulong )pram -fm_muram_base (fm_eth->fm_index);/* enable global mode- snooping data buffers and BDs */ out_be32 (&pram->mode,PRAM_MODE_GLOBAL );
@@ -258,7 +258,8 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)muram_writew (&rxbd->status, RxBD_EMPTY);muram_writew (&rxbd->len,0 );muram_writew (&rxbd->buf_ptr_hi,0 ); -out_be32 (&rxbd->buf_ptr_lo, (u32 )rx_buf_pool + i *MAX_RXBUF_LEN ); +out_be32 (&rxbd->buf_ptr_lo, (u32 )(ulong )rx_buf_pool + + i *MAX_RXBUF_LEN ); rxbd++; }
@@ -266,7 +267,7 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) rxqd = &pram->rxqd;muram_writew (&rxqd->gen,0 );muram_writew (&rxqd->bd_ring_base_hi,0 ); -out_be32 (&rxqd->bd_ring_base_lo, (u32 )rx_bd_ring_base); +out_be32 (&rxqd->bd_ring_base_lo, (u32 )(ulong )rx_bd_ring_base);muram_writew (&rxqd->bd_ring_size,sizeof (struct fm_port_bd ) *RX_BD_RING_SIZE );muram_writew (&rxqd->offset_in,0 );
@@ -289,12 +290,12 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth)int i;/* alloc global parameter ram at MURAM */ - pram = (struct fm_port_global_pram *)fm_muram_alloc (fm_eth->fm_index, -FM_PRAM_SIZE ,FM_PRAM_ALIGN ); + pram = (struct fm_port_global_pram *)(ulong )fm_muram_alloc ( + fm_eth->fm_index,FM_PRAM_SIZE ,FM_PRAM_ALIGN ); fm_eth->tx_pram = pram;/* parameter page offset to MURAM */ - pram_page_offset = (u32 )pram -fm_muram_base (fm_eth->fm_index); + pram_page_offset = (u32 )(ulong )pram -fm_muram_base (fm_eth->fm_index);/* enable global mode- snooping data buffers and BDs */ out_be32 (&pram->mode,PRAM_MODE_GLOBAL );
@@ -326,7 +327,7 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth)/* set the Tx queue decriptor */ txqd = &pram->txqd;muram_writew (&txqd->bd_ring_base_hi,0 ); -out_be32 (&txqd->bd_ring_base_lo, (u32 )tx_bd_ring_base); +out_be32 (&txqd->bd_ring_base_lo, (u32 )(ulong )tx_bd_ring_base);muram_writew (&txqd->bd_ring_size,sizeof (struct fm_port_bd ) *TX_BD_RING_SIZE );muram_writew (&txqd->offset_in,0 );
@@ -494,7 +495,7 @@ static int fm_eth_send(struct eth_device *dev, void *buf, int len) }/* setup TxBD */ muram_writew (&txbd->buf_ptr_hi,0 ); -out_be32 (&txbd->buf_ptr_lo, (u32 )buf); +out_be32 (&txbd->buf_ptr_lo, (u32 )(ulong )buf);muram_writew (&txbd->len, len);mb ();muram_writew (&txbd->status, TxBD_READY | TxBD_LAST);
@@ -546,7 +547,7 @@ static int fm_eth_recv(struct eth_device *dev)while (!(status & RxBD_EMPTY)) {if (!(status & RxBD_ERROR)) { - data = (u8 *)in_be32 (&rxbd->buf_ptr_lo); + data = (u8 *)(ulong )in_be32 (&rxbd->buf_ptr_lo); len =muram_readw (&rxbd->len);net_process_received_packet (data, len); }else {
drivers/net/fm/fm.c +2 -2
@@ -49,14 +49,14 @@ u32 fm_muram_alloc(int fm_idx, u32 size, u32 align) ret = muram[fm_idx].alloc; muram[fm_idx].alloc += size; -memset ((void *)ret,0 , size); +memset ((void *)(ulong )ret,0 , size);return ret; }static void fm_init_muram (int fm_idx,void *reg) { -u32 base = (u32 )reg; +u32 base = (u32 )(ulong )reg; muram[fm_idx].base = base; muram[fm_idx].size =CONFIG_SYS_FM_MURAM_SIZE ;
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 8/16 net/fm: fix compile warnings for 64-bit platform
Quoted 28 lines · Gong Qianyu
This patch fixes such compile warnings:
drivers/net/fm/eth.c: In function 'fm_eth_recv':drivers/net/fm/eth.c:549:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]data = (u8 *)in_be32(&rxbd->buf_ptr_lo); drivers/net/fm/fm.c: In function 'fm_muram_alloc': drivers/net/fm/fm.c:52:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memset((void *)ret, 0, size); drivers/net/fm/fm.c: In function 'fm_init_muram': drivers/net/fm/fm.c:59:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] u32 base = (u32)reg;Just make the cast explicit for them.
Signed-off-by Gong Qianyu <[email protected]>--- drivers/net/fm/eth.c | 31 ++++++++++++++++--------------- drivers/net/fm/fm.c | 4 ++-- 2 files changed, 18 insertions(+), 17 deletions(-)drivers/net/fm/eth.c +0
-0
drivers/net/fm/eth.c static int tgec_is_fibre(struct eth_device *dev) · line 123
Quoted 5 lines
drivers/net/fm/eth.c +1
-1@@ -120,12 +120,12 @@ static int tgec_is_fibre(struct eth_device *dev)static u16 muram_readw (u16 *addr) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;
This will still truncate the address at 32 bits. It needs to be ~0x3UL.
Quoted 25 lines
drivers/net/fm/eth.c +3
-3u32 val32 =in_be32 ((u32 *)base);int byte_pos;u16 ret; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) ret = (u16)(val32 &0x0000ffff );else @@ -136,12 +136,12 @@ static u16 muram_readw(u16 *addr)static void muram_writew (u16 *addr,u16 val) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;u32 org32 =in_be32 ((u32 *)base);u32 val32;int byte_pos; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) val32 = (org32 &0xffff0000 ) | val;else
drivers/net/fm/eth.c static int fm_eth_rx_port_parameter_init(struct · line 222
Quoted 8 lines
drivers/net/fm/eth.c +2
-2@@ -217,12 +217,12 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)int i;/* alloc global parameter ram at MURAM */ - pram = (struct fm_port_global_pram *)fm_muram_alloc (fm_eth->fm_index, -FM_PRAM_SIZE ,FM_PRAM_ALIGN ); + pram = (struct fm_port_global_pram *)(ulong )fm_muram_alloc ( + fm_eth->fm_index,FM_PRAM_SIZE ,FM_PRAM_ALIGN );
Make fm_muram_alloc() return a pointer instead. If muram were >= 4 GiB the above would fail.
drivers/net/fm/eth.c static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) · line 225
Quoted 5 lines
drivers/net/fm/eth.c +1
-1fm_eth->rx_pram = pram;/* parameter page offset to MURAM */ - pram_page_offset = (u32 )pram -fm_muram_base (fm_eth->fm_index); + pram_page_offset = (u32 )(ulong )pram -fm_muram_base (fm_eth->fm_index);
Get rid of the u32 cast -- again, if the muram base were above >= 4 GiB this would fail because you're dropping the high bits before the subtraction rather than after.
drivers/net/fm/eth.c static int fm_eth_rx_port_parameter_init(struct fm_eth · line 264
Quoted 12 lines
drivers/net/fm/eth.c +2
-1/* enable global mode- snooping data buffers and BDs */ out_be32 (&pram->mode,PRAM_MODE_GLOBAL );@@ -258,7 +258,8 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)muram_writew (&rxbd->status, RxBD_EMPTY);muram_writew (&rxbd->len,0 );muram_writew (&rxbd->buf_ptr_hi,0 ); -out_be32 (&rxbd->buf_ptr_lo, (u32 )rx_buf_pool + i *MAX_RXBUF_LEN ); +out_be32 (&rxbd->buf_ptr_lo, (u32 )(ulong )rx_buf_pool + + i *MAX_RXBUF_LEN ); rxbd++;
Use virt_to_phys() and lower_32_bits(). Is there a "hi" register to handle the upper 32 bits?
Likewise elsewhere. Don't just apply the minimum bandage to get rid of the warning. Make the code actually be 64-bit clean.
-Scott
PATCH v2 8/16 net/fm: fix compile warnings for 64-bit platform
Quoted 77 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: 2015?9?18? 2:14
To: Gong Qianyu-B52263
Cc: u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin-B53747; Xie Shaohui-B21989; Wood Scott- B07421
Subject: Re: [Patch v2 08/16] net/fm: fix compile warnings for 64-bit platformQuoted 28 lines · Gong Qianyu
This patch fixes such compile warnings:
drivers/net/fm/eth.c: In function 'fm_eth_recv':drivers/net/fm/eth.c:549:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]data = (u8 *)in_be32(&rxbd->buf_ptr_lo); drivers/net/fm/fm.c: In function 'fm_muram_alloc': drivers/net/fm/fm.c:52:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memset((void *)ret, 0, size); drivers/net/fm/fm.c: In function 'fm_init_muram': drivers/net/fm/fm.c:59:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] u32 base = (u32)reg;Just make the cast explicit for them.
Signed-off-by Gong Qianyu <[email protected]>--- drivers/net/fm/eth.c | 31 ++++++++++++++++--------------- drivers/net/fm/fm.c | 4 ++-- 2 files changed, 18 insertions(+), 17 deletions(-)drivers/net/fm/eth.c index renamed from drivers/net/fm/eth.c +0
-012eb9b8..6ef0afb 100644
drivers/net/fm/eth.c static int tgec_is_fibre(struct eth_device *dev) · line 123
Quoted 5 lines
drivers/net/fm/eth.c +1
-1@@ -120,12 +120,12 @@ static int tgec_is_fibre(struct eth_device *dev)static u16 muram_readw (u16 *addr) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;This will still truncate the address at 32 bits. It needs to be ~0x3UL.
Quoted 27 lines
drivers/net/fm/eth.c +3
-3u32 val32 =in_be32 ((u32 *)base);int byte_pos;u16 ret; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) ret = (u16)(val32 &0x0000ffff );else @@ -136,12 +136,12 @@ static u16 muram_readw(u16 *addr)static void muram_writew (u16 *addr,u16 val) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;u32 org32 =in_be32 ((u32 *)base);u32 val32;int byte_pos; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) val32 = (org32 &0xffff0000 ) | val;else @@ -217,12 +217,12 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)int i;
Quoted 10 lines
drivers/net/fm/eth.c static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) · line 221
Quoted 6 lines
drivers/net/fm/eth.c +2
-2/* alloc global parameter ram at MURAM */ - pram = (struct fm_port_global_pram *)fm_muram_alloc (fm_eth- fm_index, -FM_PRAM_SIZE ,FM_PRAM_ALIGN ); + pram = (struct fm_port_global_pram *)(ulong )fm_muram_alloc ( + fm_eth->fm_index,FM_PRAM_SIZE ,FM_PRAM_ALIGN );Make
fm_muram_alloc()return a pointer instead. If muram were >= 4 GiB the above would fail.
The muram is a region included in CCSR.
So does we take muram >= 4GiB into account make sense?
Quoted 26 lines
drivers/net/fm/eth.c static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)
Quoted 6 lines
drivers/net/fm/eth.c +2
-1fm_eth->rx_pram = pram;/* parameter page offset to MURAM */ - pram_page_offset = (u32 )pram -fm_muram_base (fm_eth->fm_index); + pram_page_offset = (u32 )(ulong )pram - +fm_muram_base (fm_eth->fm_index);Get rid of the u32 cast -- again, if the muram base were above >= 4 GiB this would fail because you're dropping the high bits before the subtraction rather than after.
Quoted 9 lines
/* enable global mode- snooping data buffers and BDs */ out_be32(&pram->mode, PRAM_MODE_GLOBAL); @@ -258,7 +258,8 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) muram_writew(&rxbd->status, RxBD_EMPTY); muram_writew(&rxbd->len, 0); muram_writew(&rxbd->buf_ptr_hi, 0);- out_be32(&rxbd->buf_ptr_lo, (u32)rx_buf_pool + i *
MAX_RXBUF_LEN);drivers/net/fm/eth.c static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) · line 263
Quoted 4 lines
drivers/net/fm/eth.c +3
-0+out_be32 (&rxbd->buf_ptr_lo, (u32 )(ulong )rx_buf_pool + + i * +MAX_RXBUF_LEN ); rxbd++;
Quoted 6 lines
Use
virt_to_phys()andlower_32_bits(). Is there a "hi" register to handle the upper 32 bits?Likewise elsewhere. Don't just apply the minimum bandage to get rid of the warning. Make the code actually be 64-bit clean.
Thanks,
Zhiqiang
PATCH v2 8/16 net/fm: fix compile warnings for 64-bit platform
Quoted 87 lines · On Thu, 2015-09-24 at 21:22 -0500, Hou Zhiqiang-B48286 wrote:
Quoted 76 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: 2015?9?18? 2:14
To: Gong Qianyu-B52263
Cc: u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin-B53747; Xie Shaohui-B21989; Wood Scott- B07421
Subject: Re: [Patch v2 08/16] net/fm: fix compile warnings for 64-bit platformQuoted 28 lines · Gong Qianyu
This patch fixes such compile warnings:
drivers/net/fm/eth.c: In function 'fm_eth_recv':drivers/net/fm/eth.c:549:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]data = (u8 *)in_be32(&rxbd->buf_ptr_lo); drivers/net/fm/fm.c: In function 'fm_muram_alloc': drivers/net/fm/fm.c:52:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memset((void *)ret, 0, size); drivers/net/fm/fm.c: In function 'fm_init_muram': drivers/net/fm/fm.c:59:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] u32 base = (u32)reg;Just make the cast explicit for them.
Signed-off-by Gong Qianyu <[email protected]>--- drivers/net/fm/eth.c | 31 ++++++++++++++++--------------- drivers/net/fm/fm.c | 4 ++-- 2 files changed, 18 insertions(+), 17 deletions(-)drivers/net/fm/eth.c index renamed from drivers/net/fm/eth.c +0
-012eb9b8..6ef0afb 100644
drivers/net/fm/eth.c static int tgec_is_fibre(struct eth_device *dev) · line 123
Quoted 5 lines
drivers/net/fm/eth.c +1
-1@@ -120,12 +120,12 @@ static int tgec_is_fibre(struct eth_device *dev)static u16 muram_readw (u16 *addr) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;This will still truncate the address at 32 bits. It needs to be ~0x3UL.
Quoted 27 lines
drivers/net/fm/eth.c +3
-3u32 val32 =in_be32 ((u32 *)base);int byte_pos;u16 ret; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) ret = (u16)(val32 &0x0000ffff );else @@ -136,12 +136,12 @@ static u16 muram_readw(u16 *addr)static void muram_writew (u16 *addr,u16 val) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;u32 org32 =in_be32 ((u32 *)base);u32 val32;int byte_pos; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) val32 = (org32 &0xffff0000 ) | val;else @@ -217,12 +217,12 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)int i;Quoted 10 lines
drivers/net/fm/eth.c static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth) · line 221
Quoted 6 lines
drivers/net/fm/eth.c +2
-2/* alloc global parameter ram at MURAM */ - pram = (struct fm_port_global_pram *)fm_muram_alloc (fm_eth- fm_index, -FM_PRAM_SIZE ,FM_PRAM_ALIGN ); + pram = (struct fm_port_global_pram *)(ulong )fm_muram_alloc ( + fm_eth->fm_index,FM_PRAM_SIZE ,FM_PRAM_ALIGN );Make
fm_muram_alloc()return a pointer instead. If muram were >= 4 GiB the above would fail.
Quoted 2 lines
The muram is a region included in CCSR.
So does we take muram >= 4GiB into account make sense?
The fact that currently, we run U-Boot as 32-bit on platforms where CCSR is
Quoted 1 line
= 4GiB is not a good excuse to be sloppy with types.
-Scott
PATCH v2 8/16 net/fm: fix compile warnings for 64-bit platform
Quoted 102 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: 2015?9?25? 10:34
To: Hou Zhiqiang-B48286
Cc: Gong Qianyu-B52263; u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Song Wenbin-B53747; Xie Shaohui-B21989
Subject: Re: [Patch v2 08/16] net/fm: fix compile warnings for 64-bit platformQuoted 42 lines · On Thu, 2015-09-24 at 21:22 -0500, Hou Zhiqiang-B48286 wrote:
Quoted 42 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: 2015?9?18? 2:14
To: Gong Qianyu-B52263
Cc: u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin-B53747; Xie Shaohui-B21989; Wood Scott- B07421
Subject: Re: [Patch v2 08/16] net/fm: fix compile warnings for 64-bit platformQuoted 30 lines · Gong Qianyu
This patch fixes such compile warnings:
drivers/net/fm/eth.c: In function 'fm_eth_recv':drivers/net/fm/eth.c:549:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]data = (u8 *)in_be32(&rxbd->buf_ptr_lo); drivers/net/fm/fm.c: In function 'fm_muram_alloc': drivers/net/fm/fm.c:52:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memset((void *)ret, 0, size); drivers/net/fm/fm.c: In function 'fm_init_muram': drivers/net/fm/fm.c:59:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] u32 base = (u32)reg;Just make the cast explicit for them.
Signed-off-by Gong Qianyu <[email protected]>--- drivers/net/fm/eth.c | 31 ++++++++++++++++--------------- drivers/net/fm/fm.c | 4 ++-- 2 files changed, 18 insertions(+), 17 deletions(-)drivers/net/fm/eth.c index renamed from drivers/net/fm/eth.c +0
-012eb9b8..6ef0afb 100644
drivers/net/fm/eth.c +0
-0@@ -120,12 +120,12 @@ static int tgec_is_fibre(struct eth_device *dev)Quoted 5 lines
Quoted 5 lines
drivers/net/fm/eth.c static int tgec_is_fibre(struct eth_device *dev) · line 123
Quoted 3 lines
drivers/net/fm/eth.c +1
-1static u16 muram_readw (u16 *addr) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;This will still truncate the address at 32 bits. It needs to be
~0x3UL.
Quoted 42 lines
Quoted 41 lines
Quoted 33 lines
drivers/net/fm/eth.c +3
-3u32 val32 =in_be32 ((u32 *)base);int byte_pos;u16 ret; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) ret = (u16)(val32 &0x0000ffff );else @@ -136,12 +136,12 @@ static u16 muram_readw(u16 *addr)static void muram_writew (u16 *addr,u16 val) { -u32 base = (u32 )addr & ~0x3 ; +ulong base = (ulong )addr & ~0x3 ;u32 org32 =in_be32 ((u32 *)base);u32 val32;int byte_pos; - byte_pos = (u32 )addr &0x3 ; + byte_pos = (ulong )addr &0x3 ;if (byte_pos) val32 = (org32 &0xffff0000 ) | val;else @@ -217,12 +217,12 @@ static intfm_eth_rx_port_parameter_init(struct
fm_eth*fm_eth)int i; /* alloc global parameter ram at MURAM */- pram = (struct
fm_port_global_pram*)fm_muram_alloc(fm_eth-fm_index,drivers/net/fm/eth.c static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)
Quoted 4 lines
drivers/net/fm/eth.c +3
-1- FM_PRAM_SIZE, FM_PRAM_ALIGN); + pram = (struct fm_port_global_pram *)(ulong )fm_muram_alloc ( + fm_eth->fm_index,FM_PRAM_SIZE , +FM_PRAM_ALIGN );Make
fm_muram_alloc()return a pointer instead. If muram were >= 4 GiB the above would fail.
Quoted 7 lines
Quoted 2 lines
The muram is a region included in CCSR.
So does we take muram >= 4GiB into account make sense?The fact that currently, we run U-Boot as 32-bit on platforms where CCSR is
Quoted 1 line
= 4GiB is not a good excuse to be sloppy with types.
ok.
Thanks,
Zhiqiang
PATCH v2 9/16 ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC
In reply to Gong QianyuFrom: Mingkai Hu <[email protected]>
Freescale LayerScape with Chassis Generation 2 is a set of SoCs with ARMv8 cores and 2rd generation of Chassis.
---
V2:
remove FSL_LS102xA_DEVDISR3_PCIE from immap_lsch2.h
arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/fsl-lsch2/Makefile | 12 + arch/arm/cpu/armv8/fsl-lsch2/README | 10 + arch/arm/cpu/armv8/fsl-lsch2/cpu.c | 414 ++++++++++++++++++ arch/arm/cpu/armv8/fsl-lsch2/fdt.c | 13 + arch/arm/cpu/armv8/fsl-lsch2/fsl_lsch2_serdes.c | 116 +++++ arch/arm/cpu/armv8/fsl-lsch2/lowlevel.S | 122 ++++++ arch/arm/cpu/armv8/fsl-lsch2/ls1043a_serdes.c | 86 ++++ arch/arm/cpu/armv8/fsl-lsch2/soc.c | 36 ++ arch/arm/cpu/armv8/fsl-lsch2/speed.c | 137 ++++++ arch/arm/cpu/armv8/fsl-lsch2/speed.h | 7 + arch/arm/include/asm/arch-fsl-lsch2/clock.h | 24 ++ arch/arm/include/asm/arch-fsl-lsch2/config.h | 150 +++++++ arch/arm/include/asm/arch-fsl-lsch2/fsl_serdes.h | 105 +++++ arch/arm/include/asm/arch-fsl-lsch2/gpio.h | 9 + arch/arm/include/asm/arch-fsl-lsch2/immap_lsch2.h | 496 ++++++++++++++++++++++ arch/arm/include/asm/arch-fsl-lsch2/imx-regs.h | 52 +++ arch/arm/include/asm/arch-fsl-lsch2/mmu.h | 10 + arch/arm/include/asm/arch-fsl-lsch2/ns_access.h | 158 +++++++ arch/arm/include/asm/arch-fsl-lsch2/soc.h | 7 + arch/arm/include/asm/arch-fsl-lsch2/spl.h | 20 + arch/arm/include/asm/armv8/mmu.h | 1 + arch/arm/include/asm/config.h | 3 + include/common.h | 3 + 24 files changed, 1992 insertions(+)
arch/arm/cpu/armv8/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-y += cache.o obj-y += tlb.o obj-y += transition.o +obj-$(CONFIG_FSL_LSCH2) += fsl-lsch2/ obj-$(CONFIG_FSL_LSCH3) += fsl-lsch3/ obj-$(CONFIG_ARCH_ZYNQMP) += zynqmp/ obj-$(CONFIG_TARGET_HIKEY) += hisilicon/
arch/arm/cpu/armv8/fsl-lsch2/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# +# Copyright 2015, Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += cpu.o +obj-y += soc.o +obj-y += lowlevel.o +obj-y += speed.o +obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch2_serdes.o ls1043a_serdes.o +obj-$(CONFIG_OF_LIBFDT) += fdt.o
arch/arm/cpu/armv8/fsl-lsch2/README new file +10 -0
@@ -0,0 +1,10 @@ +# +# Copyright 2015 Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +Freescale LayerScape with Chassis Generation 2 + +This architecture supports Freescale ARMv8 SoCs with Chassis generation 2, +for example LS1043A.
arch/arm/cpu/armv8/fsl-lsch2/cpu.c new file +414 -0
414 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-lsch2/fdt.c new file +13 -0
@@ -0,0 +1,13 @@ +/* +* Copyright 2015 Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <libfdt.h> +#include <fdt_support.h> + +void ft_cpu_setup (void *blob,bd_t *bd) +{ +}
arch/arm/cpu/armv8/fsl-lsch2/fsl_lsch2_serdes.c new file +116 -0
116 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-lsch2/lowlevel.S new file +122 -0
122 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-lsch2/ls1043a_serdes.c new file +86 -0
86 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-lsch2/soc.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright 2015 Freescale Semiconductor +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <fsl_ifc.h> +#include <asm/arch-fsl-lsch2/soc.h> +#include <asm/io.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR ; + +void fsl_lsch2_early_init_f (void ) +{ +struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR ; + +#ifdef CONFIG_FSL_IFC +init_early_memctl_regs ();/* tighten IFC timing */ +#endif + +/* +* Enable snoop requests and DVM message requests for +* Slave insterface S4 (A53 core cluster) +*/ +out_le32 (&cci->slave[4 ].snoop_ctrl, +CCI400_DVM_MESSAGE_REQ_EN |CCI400_SNOOP_REQ_EN ); +} + +#ifdef CONFIG_BOARD_LATE_INIT +int board_late_init (void ) +{ +return 0 ; +} +#endif
arch/arm/cpu/armv8/fsl-lsch2/speed.c new file +137 -0
137 lines not on this page · raw message
arch/arm/cpu/armv8/fsl-lsch2/speed.h new file +7 -0
@@ -0,0 +1,7 @@ +/* +* Copyright 2014, Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +void get_sys_info (struct sys_info *sys_info);
arch/arm/include/asm/arch-fsl-lsch2/clock.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Copyright 2015 Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +* +*/ + +#ifndef __ASM_ARCH_FSL_LSCH2_CLOCK_H_ +#define __ASM_ARCH_FSL_LSCH2_CLOCK_H_ + +#include <common.h> + +enum mxc_clock { +MXC_ARM_CLK =0 , +MXC_BUS_CLK , +MXC_UART_CLK , +MXC_ESDHC_CLK , +MXC_I2C_CLK , +MXC_DSPI_CLK , +}; + +unsigned int mxc_get_clock (enum mxc_clock clk); + +#endif /* __ASM_ARCH_FSL_LSCH2_CLOCK_H_ */
arch/arm/include/asm/arch-fsl-lsch2/config.h new file +150 -0
150 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-lsch2/fsl_serdes.h new file +105 -0
105 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-lsch2/gpio.h new file +9 -0
@@ -0,0 +1,9 @@ +/* +* (C) Copyright 2015, Freescale Semiconductor +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _ASM_ARMV8_FSL_LSCH2_GPIO_H_ +#define _ASM_ARMV8_FSL_LSCH2_GPIO_H_ +#endif /* _ASM_ARMV8_FSL_LSCH2_GPIO_H_ */
arch/arm/include/asm/arch-fsl-lsch2/immap_lsch2.h new file +496 -0
496 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-lsch2/imx-regs.h new file +52 -0
52 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-lsch2/mmu.h new file +10 -0
@@ -0,0 +1,10 @@ +/* +* Copyright 2015, Freescale Semiconductor +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _ASM_ARMV8_FSL_LSCH2_MMU_H_ +#define _ASM_ARMV8_FSL_LSCH2_MMU_H_ +#include <asm/arch-armv8/mmu.h> +#endif /* _ASM_ARMV8_FSL_LSCH2_MMU_H_ */
arch/arm/include/asm/arch-fsl-lsch2/ns_access.h new file +158 -0
158 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-lsch2/soc.h new file +7 -0
@@ -0,0 +1,7 @@ +/* +* Copyright 2015 Freescale Semiconductor +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +void fsl_lsch2_early_init_f (void );
arch/arm/include/asm/arch-fsl-lsch2/spl.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Copyright 2014 Freescale Semiconductor, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __ASM_ARCH_SPL_H__ +#define __ASM_ARCH_SPL_H__ + +#define BOOT_DEVICE_NONE 0 +#define BOOT_DEVICE_XIP 1 +#define BOOT_DEVICE_XIPWAIT 2 +#define BOOT_DEVICE_NAND 3 +#define BOOT_DEVICE_ONENAND 4 +#define BOOT_DEVICE_MMC1 5 +#define BOOT_DEVICE_MMC2 6 +#define BOOT_DEVICE_MMC2_2 7 +#define BOOT_DEVICE_SPI 10 + +#endif /* __ASM_ARCH_SPL_H__ */
arch/arm/include/asm/armv8/mmu.h +1 -0
@@ -65,6 +65,7 @@/* * Section */ +#define PMD_SECT_NS (1 << 5)#define PMD_SECT_NON_SHARE (0 << 8)#define PMD_SECT_OUTER_SHARE (2 << 8)#define PMD_SECT_INNER_SHARE (3 << 8)
arch/arm/include/asm/config.h +3 -0
@@ -18,6 +18,9 @@#ifdef CONFIG_FSL_LSCH3 #include <asm/arch-fsl-lsch3/config.h> #endif +#ifdef CONFIG_FSL_LSCH2 +#include <asm/arch-fsl-lsch2/config.h> +#endif #if defined(CONFIG_LS102XA) || \ defined(CONFIG_CPU_PXA27X) || \
include/common.h +3 -0
@@ -76,6 +76,9 @@ typedef volatile unsigned char vu_char;#ifdef CONFIG_SOC_DA8XX #include <asm/arch/hardware.h> #endif +#ifdef CONFIG_LS1043A +#include <asm/arch-fsl-lsch2/immap_lsch2.h> +#endif #include <part.h> #include <flash.h>
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 9/16 ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC
Quoted 9 lines · Gong Qianyu
From: Mingkai Hu <[email protected]>
Freescale LayerScape with Chassis Generation 2 is a set of SoCs with ARMv8 cores and 2rd generation of Chassis.
Signed-off-by Li Yang <[email protected]>Signed-off-by Hou Zhiqiang <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>
Quoted 8 lines
---
V2:
removeFSL_LS102xA_DEVDISR3_PCIEfromimmap_lsch2.harch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/fsl-lsch2/Makefile | 12 + arch/arm/cpu/armv8/fsl-lsch2/README | 10 + arch/arm/cpu/armv8/fsl-lsch2/cpu.c | 414 ++++++++++++++++++
Too much duplication. Please work with Alison/Prabhakar to move out the common code in cpu.c.
York
PATCH v2 9/16 ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC
Quoted 26 lines
-----Original Message-----
From: Sun York-R58495
Sent: Tuesday, September 22, 2015 1:27 AM
To: Gong Qianyu-B52263; u-boot at lists.denx.de
Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin- B53747; Xie Shaohui-B21989; Wood Scott-B07421; Li Yang-Leo-R58472
Subject: Re: [Patch v2 09/16] ARMv8/FSL_LSCH2: AddFSL_LSCH2SoCQuoted 13 lines · Gong Qianyu
From: Mingkai Hu <[email protected]>
Freescale LayerScape with Chassis Generation 2 is a set of SoCs with ARMv8 cores and 2rd generation of Chassis.
Signed-off-by Li Yang <[email protected]>Signed-off-by Hou Zhiqiang <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>---
V2:
removeFSL_LS102xA_DEVDISR3_PCIEfromimmap_lsch2.h
Quoted 9 lines
Quoted 4 lines
arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/fsl-lsch2/Makefile | 12 + arch/arm/cpu/armv8/fsl-lsch2/README | 10 + arch/arm/cpu/armv8/fsl-lsch2/cpu.c | 414++++++++++++++++++
Too much duplication. Please work with Alison/Prabhakar to move out the common code in
cpu.c.
I agree, there are too much duplications between lsch2 and lsch3:
arch/arm/cpu/armv8/fsl-lsch*arch/arm/include/asm/arch-fsl-lsch*
I am considering to consolidate the code between lsch2 and lsch3 using arch-layerscape. The basic idea is to add the following directory for ARMv8 layerscape for the common files and use CONFIG_FSL_LSCH2/ CONFIG_FSL_LSCH3 to differentiate the difference between these two chassis in the same file if necessary.
arch/arm/cpu/armv8/fsl-layerscapearch/arm/include/asm/arch-fsl-layerscape/
what is your suggestion?
We will send out version 3 to address the other comments and use it as the base for such consolidation.
Thanks,
Mingkai
PATCH v2 9/16 ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC
Quoted 41 lines · On 09/25/2015 05:28 AM, Hu Mingkai-B21284 wrote:
Quoted 26 lines
-----Original Message-----
From: Sun York-R58495
Sent: Tuesday, September 22, 2015 1:27 AM
To: Gong Qianyu-B52263; u-boot at lists.denx.de
Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin- B53747; Xie Shaohui-B21989; Wood Scott-B07421; Li Yang-Leo-R58472
Subject: Re: [Patch v2 09/16] ARMv8/FSL_LSCH2: AddFSL_LSCH2SoCQuoted 13 lines · Gong Qianyu
From: Mingkai Hu <[email protected]>
Freescale LayerScape with Chassis Generation 2 is a set of SoCs with ARMv8 cores and 2rd generation of Chassis.
Signed-off-by Li Yang <[email protected]>Signed-off-by Hou Zhiqiang <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>---
V2:
removeFSL_LS102xA_DEVDISR3_PCIEfromimmap_lsch2.hQuoted 9 lines
Quoted 4 lines
arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/fsl-lsch2/Makefile | 12 + arch/arm/cpu/armv8/fsl-lsch2/README | 10 + arch/arm/cpu/armv8/fsl-lsch2/cpu.c | 414++++++++++++++++++
Too much duplication. Please work with Alison/Prabhakar to move out the common code in
cpu.c.I agree, there are too much duplications between lsch2 and lsch3:
arch/arm/cpu/armv8/fsl-lsch*arch/arm/include/asm/arch-fsl-lsch*
Quoted 7 lines
I am considering to consolidate the code between lsch2 and lsch3 using arch-layerscape. The basic idea is to add the following directory for ARMv8 layerscape for the common files and use CONFIG_FSL_LSCH2/
CONFIG_FSL_LSCH3to differentiate the difference between these two chassis in the same file if necessary.
arch/arm/cpu/armv8/fsl-layerscapearch/arm/include/asm/arch-fsl-layerscape/what is your suggestion?
I think it is worth a try.
York
PATCH v2 9/16 ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC
Quoted 54 lines
-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of York Sun
Sent: Friday, September 25, 2015 8:23 PM
To: Hu Mingkai-B21284 <[email protected]>; Gong Qianyu-B52263 <[email protected]>; u-boot at lists.denx.de
Cc: Wood Scott-B07421 <[email protected]>; Li Yang-Leo-R58472 <[email protected]>; Hou Zhiqiang-B48286 <[email protected]>; Song Wenbin-B53747 <[email protected]>
Subject: Re: [U-Boot] [Patch v2 09/16] ARMv8/FSL_LSCH2: AddFSL_LSCH2SoCQuoted 39 lines · On 09/25/2015 05:28 AM, Hu Mingkai-B21284 wrote:
Quoted 27 lines
-----Original Message-----
From: Sun York-R58495
Sent: Tuesday, September 22, 2015 1:27 AM
To: Gong Qianyu-B52263; u-boot at lists.denx.de
Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin- B53747; Xie Shaohui-B21989; Wood Scott-B07421; Li Yang-Leo-R58472
Subject: Re: [Patch v2 09/16] ARMv8/FSL_LSCH2: AddFSL_LSCH2SoCQuoted 13 lines · Gong Qianyu
From: Mingkai Hu <[email protected]>
Freescale LayerScape with Chassis Generation 2 is a set of SoCs with ARMv8 cores and 2rd generation of Chassis.
Signed-off-by Li Yang <[email protected]>Signed-off-by Hou Zhiqiang <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>---
V2:
removeFSL_LS102xA_DEVDISR3_PCIEfromimmap_lsch2.hQuoted 9 lines
Quoted 4 lines
arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/fsl-lsch2/Makefile | 12 + arch/arm/cpu/armv8/fsl-lsch2/README | 10 + arch/arm/cpu/armv8/fsl-lsch2/cpu.c | 414++++++++++++++++++
Too much duplication. Please work with Alison/Prabhakar to move out the common code in
cpu.c.I agree, there are too much duplications between lsch2 and lsch3:
Quoted 13 lines
Quoted 4 lines
arch/arm/cpu/armv8/fsl-lsch*arch/arm/include/asm/arch-fsl-lsch*I am considering to consolidate the code between lsch2 and lsch3 using
arch-layerscape. The basic idea is to add the following directory for ARMv8 layerscape for the common files and use CONFIG_FSL_LSCH2/
CONFIG_FSL_LSCH3to differentiate the difference between these two chassis in the same file if necessary.Quoted 5 lines
arch/arm/cpu/armv8/fsl-layerscapearch/arm/include/asm/arch-fsl-layerscape/what is your suggestion?
Other than CONFIG_FSL_LSCH2 and CONFIG_FSL_LSCH3, we should also have CONFIG_FSL_LAYERSCAPE to enabled common code.
--prabhakar
PATCH v2 9/16 ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC
Quoted 77 lines
-----Original Message-----
From: Kushwaha Prabhakar-B32579
Sent: Sunday, September 27, 2015 12:11 PM
To: Sun York-R58495; Hu Mingkai-B21284; Gong Qianyu-B52263; u- boot at lists.denx.de
Cc: Wood Scott-B07421; Li Yang-Leo-R58472; Hou Zhiqiang-B48286; Song Wenbin-B53747
Subject: RE: [U-Boot] [Patch v2 09/16] ARMv8/FSL_LSCH2: AddFSL_LSCH2SoCQuoted 65 lines
-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of York Sun
Sent: Friday, September 25, 2015 8:23 PM
To: Hu Mingkai-B21284 <[email protected]>; Gong Qianyu-B52263 <[email protected]>; u-boot at lists.denx.de
Cc: Wood Scott-B07421 <[email protected]>; Li Yang-Leo-R58472 <[email protected]>; Hou Zhiqiang-B48286 <[email protected]>; Song Wenbin-B53747 <[email protected]>
Subject: Re: [U-Boot] [Patch v2 09/16] ARMv8/FSL_LSCH2: AddFSL_LSCH2SoCQuoted 38 lines · On 09/25/2015 05:28 AM, Hu Mingkai-B21284 wrote:
Quoted 28 lines
-----Original Message-----
From: Sun York-R58495
Sent: Tuesday, September 22, 2015 1:27 AM
To: Gong Qianyu-B52263; u-boot at lists.denx.de
Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin- B53747; Xie Shaohui-B21989; Wood Scott-B07421; Li Yang-Leo-R58472
Subject: Re: [Patch v2 09/16] ARMv8/FSL_LSCH2: AddFSL_LSCH2SoCQuoted 14 lines · Gong Qianyu
From: Mingkai Hu <[email protected]>
Freescale LayerScape with Chassis Generation 2 is a set of SoCs with
ARMv8 cores and 2rd generation of Chassis.Signed-off-by Li Yang <[email protected]>Signed-off-by Hou Zhiqiang <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>---
V2:
removeFSL_LS102xA_DEVDISR3_PCIEfromimmap_lsch2.hQuoted 9 lines
Quoted 4 lines
arch/arm/cpu/armv8/Makefile | 1 + arch/arm/cpu/armv8/fsl-lsch2/Makefile | 12 + arch/arm/cpu/armv8/fsl-lsch2/README | 10 + arch/arm/cpu/armv8/fsl-lsch2/cpu.c | 414++++++++++++++++++
Too much duplication. Please work with Alison/Prabhakar to move out the common code in
cpu.c.Quoted 7 lines
I agree, there are too much duplications between lsch2 and lsch3:
arch/arm/cpu/armv8/fsl-lsch*arch/arm/include/asm/arch-fsl-lsch*I am considering to consolidate the code between lsch2 and lsch3 using
arch-layerscape. The basic idea is to add the following directory for ARMv8 layerscape for the common files and use CONFIG_FSL_LSCH2/
CONFIG_FSL_LSCH3to differentiate the difference between these two chassis in the same file if necessary.Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
arch/arm/cpu/armv8/fsl-layerscapearch/arm/include/asm/arch-fsl-layerscape/what is your suggestion?
Other than
CONFIG_FSL_LSCH2andCONFIG_FSL_LSCH3, we should also haveCONFIG_FSL_LAYERSCAPEto enabled common code.
Sure. We need a macro to enable the common code.
Thanks,
Mingkai
PATCH v2 10/16 ARMv8/ls1043ardb: Add LS1043ARDB board support
In reply to Gong QianyuFrom: Mingkai Hu <[email protected]>
LS1043ARDB Specification:
-------------------------
Memory subsystem:
* 2GByte DDR4 SDRAM (32bit but)
* 128 Mbyte NOR flash single-chip memory
* 512 Mbyte NAND flash
* 16 Mbyte high-speed SPI memory
* SD connector to interface with the SD memory card
Ethernet:
* XFI 10G port
* QSGMII with 4x 1G ports
* Two RGMII ports
PCIe:
* PCIe2 (Lanes C) to mini-PCIe slot
* PCIe3 (Lanes D) to PCIe slot
USB 3.0: two super speed USB 3.0 type A ports
UART: supports two UARTs up to 115200 bps for console
---
V2:
Replaced ns_access.h with fsl_csu.h.
arch/arm/Kconfig | 7 ++ board/freescale/ls1043ardb/Kconfig | 16 +++ board/freescale/ls1043ardb/MAINTAINERS | 7 ++ board/freescale/ls1043ardb/Makefile | 9 ++ board/freescale/ls1043ardb/README | 87 +++++++++++++++ board/freescale/ls1043ardb/cpld.c | 115 +++++++++++++++++++ board/freescale/ls1043ardb/cpld.h | 43 +++++++ board/freescale/ls1043ardb/ddr.c | 190 +++++++++++++++++++++++++++++++ board/freescale/ls1043ardb/ddr.h | 45 ++++++++ board/freescale/ls1043ardb/ls1043ardb.c | 134 ++++++++++++++++++++++ configs/ls1043ardb_defconfig | 3 + drivers/i2c/mxc_i2c.c | 2 +- include/configs/ls1043a_common.h | 131 ++++++++++++++++++++++ include/configs/ls1043ardb.h | 191 ++++++++++++++++++++++++++++++++ 14 files changed, 979 insertions(+), 1 deletion(-)
arch/arm/Kconfig +7 -0
@@ -662,6 +662,12 @@ config TARGET_LS1021ATWR select CPU_V7 select SUPPORT_SPL +config TARGET_LS1043ARDB + bool "Support ls1043ardb" + select ARM64 + help + Support for Freescale LS1043ARDB platform. + config TARGET_BALLOON3 bool "Support balloon3" select CPU_PXA
@@ -827,6 +833,7 @@ source "board/freescale/ls2085aqds/Kconfig" source "board/freescale/ls2085ardb/Kconfig" source "board/freescale/ls1021aqds/Kconfig" source "board/freescale/ls1021atwr/Kconfig" +source "board/freescale/ls1043ardb/Kconfig" source "board/freescale/mx23evk/Kconfig" source "board/freescale/mx25pdk/Kconfig" source "board/freescale/mx28evk/Kconfig"
board/freescale/ls1043ardb/Kconfig new file +16 -0
@@ -0,0 +1,16 @@ + +if TARGET_LS1043ARDB + +config SYS_BOARD + default "ls1043ardb" + +config SYS_VENDOR + default "freescale" + +config SYS_SOC + default "fsl-lsch2" + +config SYS_CONFIG_NAME + default "ls1043ardb" + +endif
board/freescale/ls1043ardb/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +LS1043A BOARD +M: Mingkai Hu <[email protected]> +S: Maintained +F: board/freescale/ls1043ardb/ +F: board/freescale/ls1043ardb/ls1043ardb.c +F: include/configs/ls1043ardb.h +F: configs/ls1043ardb_defconfig
board/freescale/ls1043ardb/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# Copyright 2015 Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += cpld.o +obj-y += ddr.o +obj-y += ls1043ardb.o
board/freescale/ls1043ardb/README new file +87 -0
87 lines not on this page · raw message
board/freescale/ls1043ardb/cpld.c new file +115 -0
115 lines not on this page · raw message
board/freescale/ls1043ardb/cpld.h new file +43 -0
43 lines not on this page · raw message
board/freescale/ls1043ardb/ddr.c new file +190 -0
190 lines not on this page · raw message
board/freescale/ls1043ardb/ddr.h new file +45 -0
45 lines not on this page · raw message
board/freescale/ls1043ardb/ls1043ardb.c new file +134 -0
134 lines not on this page · raw message
configs/ls1043ardb_defconfig new file +3 -0
@@ -0,0 +1,3 @@ +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4" +CONFIG_ARM=y +CONFIG_TARGET_LS1043ARDB=y
drivers/i2c/mxc_i2c.c +1 -1
@@ -524,7 +524,7 @@ static int bus_i2c_write(struct mxc_i2c_bus *i2c_bus, u8 chip, u32 addr, static struct mxc_i2c_bus mxc_i2c_buses[] = {#if defined(CONFIG_LS102XA ) || defined(CONFIG_FSL_LSCH3 ) || \ - defined(CONFIG_VF610 ) + defined(CONFIG_VF610 ) || defined(CONFIG_FSL_LSCH2 ) { 0, I2C1_BASE_ADDR, I2C_QUIRK_FLAG }, { 1, I2C2_BASE_ADDR, I2C_QUIRK_FLAG }, { 2, I2C3_BASE_ADDR, I2C_QUIRK_FLAG },
include/configs/ls1043a_common.h new file +131 -0
131 lines not on this page · raw message
include/configs/ls1043ardb.h new file +191 -0
191 lines not on this page · raw message
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 10/16 ARMv8/ls1043ardb: Add LS1043ARDB board support
Quoted 6 lines · Gong Qianyu
From: Mingkai Hu <[email protected]>
LS1043ARDB Specification:
-------------------------
Memory subsystem:
* 2GByte DDR4 SDRAM (32bit but)
Do you mean "bus" here?
Quoted 3 lines
* 128 Mbyte NOR flash single-chip memory
* 512 Mbyte NAND flash
* 16 Mbyte high-speed SPI memory
Do you mean "SPI flash"?
Quoted 22 lines
* SD connector to interface with the SD memory card
Ethernet:
* XFI 10G port
* QSGMII with 4x 1G ports
* Two RGMII portsPCIe:
* PCIe2 (Lanes C) to mini-PCIe slot
* PCIe3 (Lanes D) to PCIe slotUSB 3.0: two super speed USB 3.0 type A ports
UART: supports two UARTs up to 115200 bps for console
Signed-off-by Hou Zhiqiang <[email protected]>Signed-off-by Li Yang <[email protected]>Signed-off-by Mingkai Hu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>---
V2:
Replacedns_access.hwithfsl_csu.h.
<snip>
Quoted 80 lines
board/freescale/ls1043ardb/README new file +77
-0@@ -0,0 +1,87 @@ +Overview +-------- +The LS1043A Reference Design Board (RDB) is a high-performance computing, +evaluation, and development platform that supports the QorIQ LS1043A +LayerScape Architecture processor. The LS1043ARDB provides SW development +platform for the Freescale LS1043A processor series, with a complete +debugging environment. The LS1043A RDB is lead-free and RoHS-compliant. + +LS1043A SoC Overview +-------------------- +The LS1043A integrated multicore processor combines four ARM Cortex-A53 +processor cores with datapath acceleration optimized for L2/3 packet +processing, single pass security offload and robust traffic management +and quality of service. + +The LS1043A SoC includes the following function and features: + - Four 64-bit ARM Cortex-A53 CPUs + - 1 MB unified L2 Cache + - One 32-bit DDR3L/DDR4 SDRAM memory controllers with ECC and interleaving + support + - Data Path Acceleration Architecture (DPAA) incorporating acceleration the + the following functions: + - Packet parsing, classification, and distribution (FMan) + - Queue management for scheduling, packet sequencing, and congestion + management (QMan) + - Hardware buffer management for buffer allocation and de-allocation (BMan) + - Cryptography acceleration (SEC) + - Ethernet interfaces by FMan + - Up to 1 x XFI supporting 10G interface + - Up to 1 x QSGMII + - Up to 4 x SGMII supporting 1000Mbps + - Up to 2 x SGMII supporting 2500Mbps + - Up to 2 x RGMII supporting 1000Mbps + - High-speed peripheral interfaces + - Three PCIe 2.0 controllers, one supporting x4 operation + - One serial ATA (SATA 3.0) controllers + - Additional peripheral interfaces + - Three high-speed USB 3.0 controllers with integrated PHY + - Enhanced secure digital host controller (eSDXC/eMMC) + - Quad Serial Peripheral Interface (QSPI) Controller + - Serial peripheral interface (SPI) controller + - Four I2C controllers + - Two DUARTs + - Integrated flash controller supporting NAND and NOR flash + - QorIQ platform's trust architecture 2.1 + + LS1043ARDB board Overview + ----------------------- + - SERDES Connections, 4 lanes supporting: + - PCI Express 2.0 with two PCIe connectors supporting: miniPCIe card and + standard PCIe card + - QSGMII with x4 RJ45 connector + - XFI with x1 RJ45 connector + - DDR Controller + - 2GB 32bits DDR4 SDRAM. Support rates of up to 1600MT/s + -IFC/Local Bus + - One 128MB NOR flash 16-bit data bus + - One 512 MB NAND flash with ECC support + - CPLD connection + - USB 3.0 + - Two super speed USB 3.0 Type A ports + - SDHC: connects directly to a full SD/MMC slot + - DSPI: 16 MB high-speed flash Memory for boot code and storage (up to 108MHz) + - 4 I2C controllers + - UART + - Two 4-pin serial ports at up to 115.2 Kbit/s + - Two DB9 D-Type connectors supporting one Serial port each + - ARM JTAG support + +Memory map from core's view +---------------------------- +Start Address End Address Description Size +0x00_0000_0000 0x00_000F_FFFF Secure Boot ROM 1MB +0x00_0100_0000 0x00_0FFF_FFFF CCSRBAR 240MB +0x00_1000_0000 0x00_1000_FFFF OCRAM0 64KB +0x00_1001_0000 0x00_1001_FFFF OCRAM1 64KB +0x00_2000_0000 0x00_20FF_FFFF DCSR 16MB
board/freescale/ls1043ardb/README line 87
Quoted 10 lines
board/freescale/ls1043ardb/README new file +10
-0+0x00_6000_0000 0x00_67FF_FFFF IFC - NOR Flash 128MB +0x00_7E80_0000 0x00_7E80_FFFF IFC - NAND Flash 64KB +0x00_7FB0_0000 0x00_7FB0_0FFF IFC - FPGA 4KB +0x00_8000_0000 0x00_FFFF_FFFF DRAM1 2GB + +Booting Options +--------------- +a) NOR boot +b) NAND boot +c) SD boot
You don't have NAND or SD boot option with this patch yet. They were added later. So you can update the README when you have those support.
<snip>
board/freescale/ls1043ardb/README
Quoted 2 lines
board/freescale/ls1043ardb/README new file +2
-0+ +#ifdef CONFIG_SYS_DDR_RAW_TIMING
Put a comment with DDR model number here.
Quoted 42 lines
board/freescale/ls1043ardb/README new file +42
-0+dimm_params_t ddr_raw_timing = { + .n_ranks = 1, + .rank_density = 2147483648u, + .capacity = 2147483648u, + .primary_sdram_width = 32, + .ec_sdram_width = 0, + .registered_dimm = 0, + .mirrored_dimm = 0, + .n_row_addr = 15, + .n_col_addr = 10, + .bank_addr_bits = 0, + .bank_group_bits = 2, + .edc_config = 0, + .burst_lengths_bitmask = 0x0c, + + .tckmin_x_ps = 938, + .tckmax_ps = 1500, + .caslat_x = 0x000DFA00, + .taa_ps = 13500, + .trcd_ps = 13500, + .trp_ps = 13500, + .tras_ps = 33000, + .trc_ps = 46500, + .trfc1_ps = 260000, + .trfc2_ps = 160000, + .trfc4_ps = 110000, + .tfaw_ps = 21000, + .trrds_ps = 3700, + .trrdl_ps = 5300, + .tccdl_ps = 5355, + .refresh_rate_ps = 7800000, + .dq_mapping[0] = 0x0, + .dq_mapping[1] = 0x0, + .dq_mapping[2] = 0x0, + .dq_mapping[3] = 0x0, + .dq_mapping[4] = 0x0, + .dq_mapping[5] = 0x0, + .dq_mapping[6] = 0x0, + .dq_mapping[7] = 0x0, + .dq_mapping[8] = 0x0, + .dq_mapping[9] = 0x0, + .dq_mapping[10] = 0x0,
board/freescale/ls1043ardb/README
Quoted 10 lines
board/freescale/ls1043ardb/README new file +10
-0+ .dq_mapping[11] = 0x0, + .dq_mapping[12] = 0x0, + .dq_mapping[13] = 0x0, + .dq_mapping[14] = 0x0, + .dq_mapping[15] = 0x0, + .dq_mapping[16] = 0x0, + .dq_mapping[17] = 0x0, + .dq_mapping_ors = 0, +}; +
You may want to try to use -M -C when generating the patch, to see if the patch can be smaller. I have a feeling many files are copy-n-paste with some modification.
York
PATCH v2 11/16 armv8/ls1043ardb: Add nand boot support
In reply to Gong Qianyu---
V2:
-Removed unecessary NAND_PAGE_SIZE in ls1043a_common.h.
-Fixed "select SUPPORT_SPL" in arch/arm/Kconfig.
-Used CONFIG_FSL_IFC instead of SPL_NAND_SUPPORT for init_early_memctl_regs() in spl.c -Replaced ns_access.h with fsl_csu.h.
arch/arm/Kconfig | 1 + arch/arm/cpu/armv8/fsl-lsch2/Makefile | 1 + arch/arm/cpu/armv8/fsl-lsch2/spl.c | 79 ++++++++++++++++++++++ arch/arm/include/asm/arch-fsl-lsch2/spl.h | 2 +- board/freescale/ls1043ardb/ls1043ardb_pbi.cfg | 14 ++++ board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg | 7 ++ configs/ls1043ardb_nand_defconfig | 4 ++ include/configs/ls1043a_common.h | 30 ++++++++ include/configs/ls1043ardb.h | 40 +++++++++++ 9 files changed, 177 insertions(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
@@ -665,6 +665,7 @@ config TARGET_LS1021ATWR config TARGET_LS1043ARDB bool "Support ls1043ardb" select ARM64 + select SUPPORT_SPL help Support for Freescale LS1043ARDB platform.
arch/arm/cpu/armv8/fsl-lsch2/Makefile +1 -0
@@ -10,3 +10,4 @@ obj-y += lowlevel.o obj-y += speed.o obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch2_serdes.o ls1043a_serdes.o obj-$(CONFIG_OF_LIBFDT) += fdt.o +obj-$(CONFIG_SPL) += spl.o
arch/arm/cpu/armv8/fsl-lsch2/spl.c new file +79 -0
79 lines not on this page · raw message
arch/arm/include/asm/arch-fsl-lsch2/spl.h +1 -1
@@ -1,5 +1,5 @@/* -* Copyright 2014 Freescale Semiconductor, Inc. +* Copyright 2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */
board/freescale/ls1043ardb/ls1043ardb_pbi.cfg new file +14 -0
@@ -0,0 +1,14 @@ +#Configure Scratch register +09570600 00000000 +09570604 10000000 +#Alt base register +09570158 00001000 +#Disable CCI barrier tranaction +09570178 0000e010 +09180000 00000008 +#USB PHY frequency sel +09570418 0000009e +0957041c 0000009e +09570420 0000009e +#flush PBI data +096100c0 000fffff
board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg new file +7 -0
@@ -0,0 +1,7 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# serdes protocol +0810000f 0c000000 00000000 00000000 +14550002 80004012 e0106000 61002000 +00000000 00000000 00000000 00038800 +00000000 00001100 00000096 00000001
configs/ls1043ardb_nand_defconfig new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_SPL=y +CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,NAND_BOOT,SYS_FSL_DDR4" +CONFIG_ARM=y +CONFIG_TARGET_LS1043ARDB=y
include/configs/ls1043a_common.h +30 -0
@@ -60,6 +60,36 @@#define CONFIG_BAUDRATE 115200#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } +/* NAND SPL */ +#ifdef CONFIG_NAND_BOOT +#define CONFIG_SPL_PBL_PAD +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds" +#define CONFIG_SPL_TARGET "u-boot-with-spl.bin" +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_SPL_WATCHDOG_SUPPORT +#define CONFIG_SPL_I2C_SUPPORT +#define CONFIG_SPL_SERIAL_SUPPORT +#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT +#define CONFIG_SPL_TEXT_BASE 0x10000000 +#define CONFIG_SPL_MAX_SIZE 0x1a000 +#define CONFIG_SPL_STACK 0x1001d000 +#define CONFIG_SPL_PAD_TO 0x1c000 +#define CONFIG_SYS_NAND_U_BOOT_OFFS CONFIG_SPL_PAD_TO +#define CONFIG_SYS_NAND_U_BOOT_SIZE (640 << 10) +#define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_SPL_MALLOC_START 0x80200000 +#define CONFIG_SPL_BSS_START_ADDR 0x80100000 +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 +#define CONFIG_SYS_MONITOR_LEN 0xa0000 +#endif +/* IFC */ #define CONFIG_FSL_IFC /*
include/configs/ls1043ardb.h +40 -0
@@ -12,7 +12,11 @@#define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO +#if defined(CONFIG_NAND_BOOT ) +#define CONFIG_SYS_TEXT_BASE 0x82000000 +#else #define CONFIG_SYS_TEXT_BASE 0x60100000 +#endif #define CONFIG_SYS_CLK_FREQ 100000000#define CONFIG_DDR_CLK_FREQ 100000000
@@ -33,6 +37,14 @@#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER #define CONFIG_MEM_INIT_VALUE 0xdeadbeef +#ifdef CONFIG_RAMBOOT_PBL +#define CONFIG_SYS_FSL_PBL_PBI board/freescale/ls1043ardb/ls1043ardb_pbi.cfg +#endif + +#ifdef CONFIG_NAND_BOOT +#define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg +#endif +/* * NOR Flash Definitions */
@@ -144,6 +156,25 @@#define CONFIG_SYS_CPLD_FTIM3 0x0/* IFC Timing Params */ +#ifdef CONFIG_NAND_BOOT +#define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NAND_CSPR_EXT +#define CONFIG_SYS_CSPR0 CONFIG_SYS_NAND_CSPR +#define CONFIG_SYS_AMASK0 CONFIG_SYS_NAND_AMASK +#define CONFIG_SYS_CSOR0 CONFIG_SYS_NAND_CSOR +#define CONFIG_SYS_CS0_FTIM0 CONFIG_SYS_NAND_FTIM0 +#define CONFIG_SYS_CS0_FTIM1 CONFIG_SYS_NAND_FTIM1 +#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NAND_FTIM2 +#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NAND_FTIM3 + +#define CONFIG_SYS_CSPR1_EXT CONFIG_SYS_NOR_CSPR_EXT +#define CONFIG_SYS_CSPR1 CONFIG_SYS_NOR_CSPR +#define CONFIG_SYS_AMASK1 CONFIG_SYS_NOR_AMASK +#define CONFIG_SYS_CSOR1 CONFIG_SYS_NOR_CSOR +#define CONFIG_SYS_CS1_FTIM0 CONFIG_SYS_NOR_FTIM0 +#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NOR_FTIM1 +#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NOR_FTIM2 +#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NOR_FTIM3 +#else #define CONFIG_SYS_CSPR0_EXT CONFIG_SYS_NOR_CSPR_EXT#define CONFIG_SYS_CSPR0 CONFIG_SYS_NOR_CSPR#define CONFIG_SYS_AMASK0 CONFIG_SYS_NOR_AMASK
@@ -161,6 +192,7 @@#define CONFIG_SYS_CS1_FTIM1 CONFIG_SYS_NAND_FTIM1#define CONFIG_SYS_CS1_FTIM2 CONFIG_SYS_NAND_FTIM2#define CONFIG_SYS_CS1_FTIM3 CONFIG_SYS_NAND_FTIM3 +#endif #define CONFIG_SYS_CSPR2_EXT CONFIG_SYS_CPLD_CSPR_EXT#define CONFIG_SYS_CSPR2 CONFIG_SYS_CPLD_CSPR
@@ -183,9 +215,17 @@/* * Environment */ +#define CONFIG_ENV_OVERWRITE + +#if defined(CONFIG_NAND_BOOT ) +#define CONFIG_ENV_IS_IN_NAND +#define CONFIG_ENV_SIZE 0x2000 +#define CONFIG_ENV_OFFSET (10 * CONFIG_SYS_NAND_BLOCK_SIZE) +#else #define CONFIG_ENV_IS_IN_FLASH #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x200000)#define CONFIG_ENV_SECT_SIZE 0x20000#define CONFIG_ENV_SIZE 0x20000 +#endif #endif /* __LS1043ARDB_H__ */
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 11/16 armv8/ls1043ardb: Add nand boot support
Quoted 14 lines · Gong Qianyu
include/configs/ls1043a_common.h +11
-0+/* NAND SPL */ +#ifdef CONFIG_NAND_BOOT +#define CONFIG_SPL_PBL_PAD +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds" +#define CONFIG_SPL_TARGET "u-boot-with-spl.bin" +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_SPL_WATCHDOG_SUPPORT +#define CONFIG_SPL_I2C_SUPPORT
include/configs/ls1043a_common.h line 83
Quoted 10 lines
include/configs/ls1043a_common.h +10
-0+#define CONFIG_SPL_SERIAL_SUPPORT +#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT +#define CONFIG_SPL_TEXT_BASE 0x10000000 +#define CONFIG_SPL_MAX_SIZE 0x1a000 +#define CONFIG_SPL_STACK 0x1001d000 +#define CONFIG_SPL_PAD_TO 0x1c000 +#define CONFIG_SYS_NAND_U_BOOT_OFFS CONFIG_SPL_PAD_TO +#define CONFIG_SYS_NAND_U_BOOT_SIZE (640 << 10)
You made the U-Boot size be block aligned (assuming 128k block size, which the SoC common file should not do), but its offset is not.
-Scott
PATCH v2 11/16 armv8/ls1043ardb: Add nand boot support
Quoted 38 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: Friday, September 18, 2015 4:16 AM
To: Gong Qianyu-B52263
Cc: u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin-B53747; Xie Shaohui-B21989; Wood Scott- B07421
Subject: Re: [Patch v2 11/16] armv8/ls1043ardb: Add nand boot supportinclude/configs/ls1043a_common.h
Quoted 8 lines · Gong Qianyu
include/configs/ls1043a_common.h +5
-0+/* NAND SPL */ +#ifdef CONFIG_NAND_BOOT +#define CONFIG_SPL_PBL_PAD +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-
spl.lds"Quoted 4 lines
include/configs/ls1043a_common.h +4
-0+#define CONFIG_SPL_TARGET "u-boot-with-spl.bin" +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_SPL_WATCHDOG_SUPPORT #define CONFIG_SPL_I2C_SUPPORTinclude/configs/ls1043a_common.h
Quoted 10 lines
include/configs/ls1043a_common.h +10
-0+#define CONFIG_SPL_SERIAL_SUPPORT #define +CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT +#define CONFIG_SPL_TEXT_BASE 0x10000000 +#define CONFIG_SPL_MAX_SIZE 0x1a000 +#define CONFIG_SPL_STACK 0x1001d000 +#define CONFIG_SPL_PAD_TO 0x1c000 +#define CONFIG_SYS_NAND_U_BOOT_OFFS CONFIG_SPL_PAD_TO #define +CONFIG_SYS_NAND_U_BOOT_SIZE (640 <<10 )You made the U-Boot size be block aligned (assuming 128k block size, which the SoC common file should not do), but its offset is not.
Quoted 1 line
-Scott
Eh, yes. The CONFIG_SPL_PAD_TO should be block aligned and put to board specific file assuming different NAND chips. That reminds me. SPL and U-Boot size should be block aligned, so it is with the env size. Right?
Regards,
Qianyu
PATCH v2 11/16 armv8/ls1043ardb: Add nand boot support
Quoted 37 lines · On Thu, 2015-09-17 at 22:36 -0500, Gong Qianyu-B52263 wrote:
Quoted 37 lines
-----Original Message-----
From: Wood Scott-B07421
Sent: Friday, September 18, 2015 4:16 AM
To: Gong Qianyu-B52263
Cc: u-boot at lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song Wenbin-B53747; Xie Shaohui-B21989; Wood Scott- B07421
Subject: Re: [Patch v2 11/16] armv8/ls1043ardb: Add nand boot supportinclude/configs/ls1043a_common.h
Quoted 8 lines · Gong Qianyu
include/configs/ls1043a_common.h +5
-0+/* NAND SPL */ +#ifdef CONFIG_NAND_BOOT +#define CONFIG_SPL_PBL_PAD +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-
spl.lds"Quoted 4 lines
include/configs/ls1043a_common.h +4
-0+#define CONFIG_SPL_TARGET "u-boot-with-spl.bin" +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_SPL_WATCHDOG_SUPPORT #define CONFIG_SPL_I2C_SUPPORTinclude/configs/ls1043a_common.h
Quoted 10 lines
include/configs/ls1043a_common.h +10
-0+#define CONFIG_SPL_SERIAL_SUPPORT #define +CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_SPL_NAND_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT +#define CONFIG_SPL_TEXT_BASE 0x10000000 +#define CONFIG_SPL_MAX_SIZE 0x1a000 +#define CONFIG_SPL_STACK 0x1001d000 +#define CONFIG_SPL_PAD_TO 0x1c000 +#define CONFIG_SYS_NAND_U_BOOT_OFFS CONFIG_SPL_PAD_TO #define +CONFIG_SYS_NAND_U_BOOT_SIZE (640 <<10 )You made the U-Boot size be block aligned (assuming 128k block size, which the SoC common file should not do), but its offset is not.
Quoted 4 lines
Quoted 1 line
-Scott
Eh, yes. The
CONFIG_SPL_PAD_TOshould be block aligned and put to board specific file assuming different NAND chips.
Yes.
Quoted 2 lines
That reminds me. SPL and U-Boot size should be block aligned, so it is with the env size. Right?
The environment should have a full block reserved to it, but the actual environment size does not need to take up the full block. Typically U-Boot environments are smaller than a flash block, probably to reduce the amount of CRC that needs to be calculated.
-Scott
PATCH v2 12/16 armv8/ls1043ardb: Add cpld command to boot from nand
In reply to Gong Qianyu--- board/freescale/ls1043ardb/cpld.c | 18 ++++++++++++++++++ board/freescale/ls1043ardb/cpld.h | 1 + 2 files changed, 19 insertions(+)
board/freescale/ls1043ardb/cpld.c +18 -0
@@ -45,6 +45,21 @@ void cpld_set_defbank(void)CPLD_WRITE (global_rst,1 ); } +void cpld_set_nand (void ) +{ +u16 reg =CPLD_CFG_RCW_SRC_NAND ; +u8 reg5 = (u8)(reg >>1 ); +u8 reg6 = (u8)(reg &1 ); +cpld_rev_bit (®5); + +CPLD_WRITE (soft_mux_on,1 ); + +CPLD_WRITE (cfg_rcw_src1, reg5); +CPLD_WRITE (cfg_rcw_src2, reg6); + +CPLD_WRITE (system_rst,1 ); +} +#ifdef DEBUG static void cpld_dump_regs (void ) {
@@ -91,6 +106,8 @@ int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])if (strcmp (argv[1 ],"reset" ) ==0 ) {if (strcmp (argv[2 ],"altbank" ) ==0 )cpld_set_altbank (); +else if (strcmp (argv[2 ],"nand" ) ==0 ) +cpld_set_nand ();else cpld_set_defbank ();#ifdef DEBUG
@@ -109,6 +126,7 @@ U_BOOT_CMD("Reset the board or alternate bank" ,"reset: reset to default bank\n" "cpld reset altbank: reset to alternate bank\n" +"cpld reset nand: reset to boot from NAND flash\n" #ifdef DEBUG"cpld dump - display the CPLD registers\n" #endif
board/freescale/ls1043ardb/cpld.h +1 -0
@@ -40,4 +40,5 @@ void cpld_rev_bit(unsigned char *value);#define CPLD_SW_MUX_BANK_SEL 0x40#define CPLD_BANK_SEL_MASK 0x07#define CPLD_BANK_SEL_ALTBANK 0x04 +#define CPLD_CFG_RCW_SRC_NAND 0x106#endif
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 12/16 armv8/ls1043ardb: Add cpld command to boot from nand
Quoted 6 lines · Gong Qianyu
Signed-off-by Gong Qianyu <[email protected]>--- board/freescale/ls1043ardb/cpld.c | 18 ++++++++++++++++++ board/freescale/ls1043ardb/cpld.h | 1 + 2 files changed, 19 insertions(+)
Squash this patch with nand boot patch.
York
PATCH v2 13/16 armv8/ls1043a: Add Fman support
In reply to Gong QianyuFrom: Shaohui Xie <[email protected]>
--- arch/arm/cpu/armv8/fsl-lsch2/cpu.c | 19 +++++ arch/arm/cpu/armv8/fsl-lsch2/fdt.c | 7 ++ arch/arm/cpu/armv8/fsl-lsch2/speed.c | 23 ++++++ board/freescale/common/fman.c | 6 +- board/freescale/ls1043ardb/Makefile | 1 + board/freescale/ls1043ardb/eth.c | 77 +++++++++++++++++++++ board/freescale/ls1043ardb/ls1043ardb.c | 4 ++ drivers/net/fm/Makefile | 1 + drivers/net/fm/init.c | 10 ++- drivers/net/fm/ls1043.c | 119 ++++++++++++++++++++++++++++++++ include/configs/ls1043a_common.h | 12 ++++ include/configs/ls1043ardb.h | 25 +++++++ 12 files changed, 301 insertions(+), 3 deletions(-)
arch/arm/cpu/armv8/fsl-lsch2/cpu.c +19 -0
@@ -11,6 +11,7 @@#include <asm/io.h> #include <asm/arch-fsl-lsch2/immap_lsch2.h> #include <asm/arch/fsl_serdes.h> +#include <fm_eth.h> #include "speed.h" DECLARE_GLOBAL_DATA_PTR ;
@@ -358,6 +359,9 @@ int print_cpuinfo(void)printf ("\n Bus: %-4s MHz " ,strmhz (buf, sysinfo.freq_systembus));printf ("DDR: %-4s MT/s" ,strmhz (buf, sysinfo.freq_ddrbus)); +#ifdef CONFIG_SYS_DPAA_FMAN +printf (" FMAN: %-4s MHz" ,strmhz (buf, sysinfo.freq_fman[0 ])); +#endif puts ("\n" );/*
@@ -378,11 +382,26 @@ int print_cpuinfo(void) }#endif +/* +* Initializes on-chip ethernet controllers. +* to override, implement board_eth_init() +*/ +int cpu_eth_init (bd_t *bis) +{ +#ifdef CONFIG_FMAN_ENET +fm_standard_init (bis); +#endif +return 0 ; +} +int arch_early_init_r (void ) {#ifdef CONFIG_SYS_HAS_SERDES fsl_serdes_init ();#endif +#ifdef CONFIG_FMAN_ENET +fman_enet_init (); +#endif return 0 ; }
arch/arm/cpu/armv8/fsl-lsch2/fdt.c +7 -0
@@ -7,6 +7,13 @@#include <common.h> #include <libfdt.h> #include <fdt_support.h> +#include <phy.h> + +int fdt_fixup_phy_connection (void *blob,int offset,phy_interface_t phyc) +{ +return fdt_setprop_string (blob, offset,"phy-connection-type" , +phy_string_for_interface (phyc)); +}void ft_cpu_setup (void *blob,bd_t *bd) {
arch/arm/cpu/armv8/fsl-lsch2/speed.c +23 -0
@@ -25,6 +25,9 @@ void get_sys_info(struct sys_info *sys_info)struct fsl_ifc ifc_regs = {(void *)CONFIG_SYS_IFC_ADDR , (void *)NULL };u32 ccr;#endif +#ifdef CONFIG_SYS_DPAA_FMAN +u32 rcw_tmp; +#endif struct ccsr_clk *clk = (void *)(CONFIG_SYS_FSL_CLK_ADDR );unsigned int cpu;const u8 core_cplx_pll[8 ] = {
@@ -79,6 +82,26 @@ void get_sys_info(struct sys_info *sys_info)#define HWA_CGA_M1_CLK_SEL 0xe0000000#define HWA_CGA_M1_CLK_SHIFT 29 +#ifdef CONFIG_SYS_DPAA_FMAN + rcw_tmp =in_be32 (&gur->rcwsr[7 ]); +switch ((rcw_tmp &HWA_CGA_M1_CLK_SEL ) >>HWA_CGA_M1_CLK_SHIFT ) { +case 2 : + sys_info->freq_fman[0 ] = freq_c_pll[0 ] /2 ; +break ; +case 3 : + sys_info->freq_fman[0 ] = freq_c_pll[0 ] /3 ; +break ; +case 6 : + sys_info->freq_fman[0 ] = freq_c_pll[1 ] /2 ; +break ; +case 7 : + sys_info->freq_fman[0 ] = freq_c_pll[1 ] /3 ; +break ; +default : +printf ("Error: Unknown FMan1 clock select!\n" ); +break ; + } +#endif #define HWA_CGA_M2_CLK_SEL 0x00000007#define HWA_CGA_M2_CLK_SHIFT 0
board/freescale/common/fman.c +5 -1
@@ -1,5 +1,5 @@/* -* Copyright 2011 Freescale Semiconductor, Inc. +* Copyright 2011-2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -10,7 +10,11 @@#include <fdt_support.h> #include <fm_eth.h> +#ifdef CONFIG_FSL_LSCH2 +#include <asm/arch/fsl_serdes.h> +#else #include <asm/fsl_serdes.h> +#endif /* * Given the following ...
board/freescale/ls1043ardb/Makefile +1 -0
@@ -7,3 +7,4 @@ obj-y += cpld.o obj-y += ddr.o obj-y += ls1043ardb.o +obj-$(CONFIG_SYS_DPAA_FMAN) += eth.o
board/freescale/ls1043ardb/eth.c new file +77 -0
77 lines not on this page · raw message
board/freescale/ls1043ardb/ls1043ardb.c +4 -0
@@ -16,6 +16,7 @@#include <scsi.h> #include <fsl_csu.h> #include <fsl_esdhc.h> +#include <fm_eth.h> #include <fsl_ifc.h> #include "cpld.h"
@@ -111,6 +112,9 @@ int misc_init_r(void)int ft_board_setup (void *blob,bd_t *bd) { +#ifdef CONFIG_SYS_DPAA_FMAN +fdt_fixup_fman_ethernet (blob); +#endif return 0 ; }
drivers/net/fm/Makefile +1 -0
@@ -37,3 +37,4 @@ obj-$(CONFIG_PPC_T4160) += t4240.o obj-$(CONFIG_PPC_T4080) += t4240.o obj-$(CONFIG_PPC_B4420) += b4860.o obj-$(CONFIG_PPC_B4860) += b4860.o +obj-$(CONFIG_LS1043A) += ls1043.o
drivers/net/fm/init.c +8 -2
@@ -1,13 +1,17 @@/* -* Copyright 2011 Freescale Semiconductor, Inc. +* Copyright 2011-2015 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */ #include <errno.h> #include <common.h> #include <asm/io.h> -#include <asm/fsl_serdes.h> #include <fsl_mdio.h> +#ifdef CONFIG_FSL_LSCH2 +#include <asm/arch/fsl_serdes.h> +#else +#include <asm/fsl_serdes.h> +#endif #include "fm.h"
@@ -153,7 +157,9 @@ void fm_disable_port(enum fm_port port)return ; fm_info[i].enabled =0 ; +#ifndef CONFIG_SYS_FMAN_V3 fman_disable_port (port); +#endif }void fm_enable_port (enum fm_port port)
drivers/net/fm/ls1043.c new file +119 -0
119 lines not on this page · raw message
include/configs/ls1043a_common.h +12 -0
@@ -115,6 +115,18 @@#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC +/* FMan ucode */ +#define CONFIG_SYS_DPAA_FMAN +#ifdef CONFIG_SYS_DPAA_FMAN +#define CONFIG_SYS_FM_MURAM_SIZE 0x60000 + +#define CONFIG_SYS_QE_FMAN_FW_IN_NOR +/* FMan fireware Pre-load address */ +#define CONFIG_SYS_FMAN_FW_ADDR 0x60300000 +#define CONFIG_SYS_QE_FMAN_FW_LENGTH 0x10000 +#define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH) +#endif +/* Miscellaneous configurable options */ #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_DDR_SDRAM_BASE + 0x10000000)#define CONFIG_ARCH_EARLY_INIT_R
include/configs/ls1043ardb.h +25 -0
@@ -228,4 +228,29 @@#define CONFIG_ENV_SIZE 0x20000#endif +/* FMan */ +#ifdef CONFIG_SYS_DPAA_FMAN +#define CONFIG_FMAN_ENET +#define CONFIG_MII +#define CONFIG_PHYLIB +#define CONFIG_PHYLIB_10G +#define CONFIG_PHY_GIGE /* Include GbE speed/duplex detection */ + +#define CONFIG_PHY_VITESSE +#define CONFIG_PHY_REALTEK +#define CONFIG_PHY_AQUANTIA + +#define RGMII_PHY1_ADDR 0x1 +#define RGMII_PHY2_ADDR 0x2 + +#define QSGMII_PORT1_PHY_ADDR 0x4 +#define QSGMII_PORT2_PHY_ADDR 0x5 +#define QSGMII_PORT3_PHY_ADDR 0x6 +#define QSGMII_PORT4_PHY_ADDR 0x7 + +#define FM1_10GEC1_PHY_ADDR 0x1 + +#define CONFIG_ETHPRIME "FM1 at DTSEC3" +#endif +#endif /* __LS1043ARDB_H__ */
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 14/16 armv8/ls1043ardb: esdhc: Add esdhc support for ls1043ardb
In reply to Gong QianyuFrom: Yangbo Lu <[email protected]>
This patch adds esdhc support for ls1043ardb.
--- arch/arm/cpu/armv8/fsl-lsch2/cpu.c | 10 ++++++++++ arch/arm/cpu/armv8/fsl-lsch2/fdt.c | 6 ++++++ arch/arm/cpu/armv8/fsl-lsch2/speed.c | 18 +++++++++++++++++- drivers/mmc/fsl_esdhc.c | 13 +++++++------ include/configs/ls1043a_common.h | 11 +++++++++++ include/fsl_esdhc.h | 2 +- 6 files changed, 52 insertions(+), 8 deletions(-)
arch/arm/cpu/armv8/fsl-lsch2/cpu.c +10 -0
@@ -12,6 +12,9 @@#include <asm/arch-fsl-lsch2/immap_lsch2.h> #include <asm/arch/fsl_serdes.h> #include <fm_eth.h> +#ifdef CONFIG_FSL_ESDHC +#include <fsl_esdhc.h> +#endif #include "speed.h" DECLARE_GLOBAL_DATA_PTR ;
@@ -382,6 +385,13 @@ int print_cpuinfo(void) }#endif +#ifdef CONFIG_FSL_ESDHC +int cpu_mmc_init (bd_t *bis) +{ +return fsl_esdhc_mmc_init (bis); +} +#endif +/* * Initializes on-chip ethernet controllers. * to override, implement board_eth_init()
arch/arm/cpu/armv8/fsl-lsch2/fdt.c +6 -0
@@ -8,6 +8,9 @@#include <libfdt.h> #include <fdt_support.h> #include <phy.h> +#ifdef CONFIG_FSL_ESDHC +#include <fsl_esdhc.h> +#endif int fdt_fixup_phy_connection (void *blob,int offset,phy_interface_t phyc) {
@@ -17,4 +20,7 @@ int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)void ft_cpu_setup (void *blob,bd_t *bd) { +#if defined(CONFIG_FSL_ESDHC ) +fdt_fixup_esdhc (blob, bd); +#endif }
arch/arm/cpu/armv8/fsl-lsch2/speed.c +17 -1
@@ -25,7 +25,7 @@ void get_sys_info(struct sys_info *sys_info)struct fsl_ifc ifc_regs = {(void *)CONFIG_SYS_IFC_ADDR , (void *)NULL };u32 ccr;#endif -#ifdef CONFIG_SYS_DPAA_FMAN +#if defined(CONFIG_FSL_ESDHC ) || defined(CONFIG_SYS_DPAA_FMAN )u32 rcw_tmp;#endif struct ccsr_clk *clk = (void *)(CONFIG_SYS_FSL_CLK_ADDR );
@@ -105,6 +105,11 @@ void get_sys_info(struct sys_info *sys_info)#define HWA_CGA_M2_CLK_SEL 0x00000007#define HWA_CGA_M2_CLK_SHIFT 0 +#if defined(CONFIG_FSL_ESDHC ) + rcw_tmp =in_be32 (&gur->rcwsr[15 ]); + rcw_tmp = (rcw_tmp &HWA_CGA_M2_CLK_SEL ) >>HWA_CGA_M2_CLK_SHIFT ; + sys_info->freq_sdhc = freq_c_pll[1 ] / rcw_tmp; +#endif #if defined(CONFIG_FSL_IFC ) ccr =in_le32 (&ifc_regs.gregs->ifc_ccr);
@@ -123,6 +128,10 @@ int get_clocks(void) gd->bus_clk = sys_info.freq_systembus; gd->mem_clk = sys_info.freq_ddrbus; +#if defined(CONFIG_FSL_ESDHC ) + gd->arch.sdhc_clk = sys_info.freq_sdhc; +#endif +if (gd->cpu_clk !=0 )return 0 ;else
@@ -139,6 +148,11 @@ ulong get_ddr_freq(ulong dummy)return gd->mem_clk; } +int get_sdhc_freq (ulong dummy) +{ +return gd->arch.sdhc_clk; +} +int get_serial_clock (void ) {return gd->bus_clk;
@@ -149,6 +163,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)switch (clk) {case MXC_I2C_CLK :return get_bus_freq (0 ); +case MXC_ESDHC_CLK : +return get_sdhc_freq (0 );case MXC_DSPI_CLK :return get_bus_freq (0 );case MXC_UART_CLK :
drivers/mmc/fsl_esdhc.c +7 -6
@@ -106,7 +106,8 @@ static uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data) xfertyp |=XFERTYP_RSPTYP_48 ;#if defined(CONFIG_MX53 ) || defined(CONFIG_PPC_T4240 ) || \ - defined(CONFIG_LS102XA ) || defined(CONFIG_LS2085A ) + defined(CONFIG_LS102XA ) || defined(CONFIG_LS2085A ) || \ + defined(CONFIG_LS1043A )if (cmd->cmdidx ==MMC_CMD_STOP_TRANSMISSION ) xfertyp |=XFERTYP_CMDTYP_ABORT ;#endif
@@ -184,7 +185,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)int timeout;struct fsl_esdhc_cfg *cfg = mmc->priv;struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg->esdhc_base; -#ifdef CONFIG_LS2085A +#if defined(CONFIG_LS2085A ) || defined(CONFIG_LS1043A )dma_addr_t addr;#endif uint wml_value;
@@ -197,7 +198,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value);#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#ifdef CONFIG_LS2085A +#if defined(CONFIG_LS2085A ) || defined(CONFIG_LS1043A ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );
@@ -223,7 +224,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#ifdef CONFIG_LS2085A +#if defined(CONFIG_LS2085A ) || defined(CONFIG_LS1043A ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );
@@ -277,7 +278,7 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)static void check_and_invalidate_dcache_range (struct mmc_cmd *cmd,struct mmc_data *data) { -#ifdef CONFIG_LS2085A +#if defined(CONFIG_LS2085A ) || defined(CONFIG_LS1043A )unsigned start =0 ;#else unsigned start = (unsigned )data->dest ;
@@ -285,7 +286,7 @@ static void check_and_invalidate_dcache_rangeunsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize);unsigned end = start+size ; -#ifdef CONFIG_LS2085A +#if defined(CONFIG_LS2085A ) || defined(CONFIG_LS1043A )dma_addr_t addr; addr =virt_to_phys ((void *)(data->dest));
include/configs/ls1043a_common.h +11 -0
@@ -115,6 +115,17 @@#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC +/* MMC */ +#define CONFIG_MMC +#ifdef CONFIG_MMC +#define CONFIG_CMD_MMC +#define CONFIG_FSL_ESDHC +#define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33 +#define CONFIG_GENERIC_MMC +#define CONFIG_CMD_FAT +#define CONFIG_DOS_PARTITION +#endif +/* FMan ucode */ #define CONFIG_SYS_DPAA_FMAN #ifdef CONFIG_SYS_DPAA_FMAN
include/fsl_esdhc.h +1 -1
@@ -166,7 +166,7 @@#define ESDHC_VENDORSPEC_VSELECT 0x00000002/* Use 1.8V */ struct fsl_esdhc_cfg { -#ifdef CONFIG_LS2085A +#if defined(CONFIG_LS2085A ) || defined(CONFIG_LS1043A )u64 esdhc_base;#else u32 esdhc_base;
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 15/16 armv8/ls1043ardb: Add sd boot support
In reply to Gong Qianyu--- board/freescale/ls1043ardb/ls1043ardb.c | 8 +++++++ board/freescale/ls1043ardb/ls1043ardb_rcw_sd.cfg | 7 ++++++ configs/ls1043ardb_sdcard_defconfig | 4 ++++ include/configs/ls1043a_common.h | 30 ++++++++++++++++++++++++ include/configs/ls1043ardb.h | 13 ++++++++-- 5 files changed, 60 insertions(+), 2 deletions(-)
board/freescale/ls1043ardb/ls1043ardb.c +8 -0
@@ -12,12 +12,14 @@#include <asm/arch/clock.h> #include <asm/arch/fsl_serdes.h> #include <hwconfig.h> +#include <mmc.h> #include <ahci.h> #include <scsi.h> #include <fsl_csu.h> #include <fsl_esdhc.h> #include <fm_eth.h> #include <fsl_ifc.h> +#include <spl.h> #include "cpld.h" DECLARE_GLOBAL_DATA_PTR ;
@@ -25,12 +27,17 @@ DECLARE_GLOBAL_DATA_PTR;int checkboard (void ) {static const char *freq[3 ] = {"100.00MHZ" ,"156.25MHZ" }; +#ifndef CONFIG_SD_BOOT u8 cfg_rcw_src1, cfg_rcw_src2;u32 cfg_rcw_src; +#endif u32 sd1refclk_sel;printf ("Board: LS1043ARDB, boot from " ); +#ifdef CONFIG_SD_BOOT +puts ("SD\n" ); +#else cfg_rcw_src1 =CPLD_READ (cfg_rcw_src1); cfg_rcw_src2 =CPLD_READ (cfg_rcw_src2);cpld_rev_bit (&cfg_rcw_src1);
@@ -43,6 +50,7 @@ int checkboard(void)puts ("NAND\n" ); else printf("Invalid setting of SW4\n"); +#endif printf ("CPLD: V%x.%x\nPCBA: V%x.0\n" ,CPLD_READ (cpld_ver),CPLD_READ (cpld_ver_sub),CPLD_READ (pcba_ver));
board/freescale/ls1043ardb/ls1043ardb_rcw_sd.cfg new file +7 -0
@@ -0,0 +1,7 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# RCW +0810000f 0c000000 00000000 00000000 +14550002 80004012 60040000 61002000 +00000000 00000000 00000000 00038800 +00000000 00001100 00000096 00000001
configs/ls1043ardb_sdcard_defconfig new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_SPL=y +CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT,SYS_FSL_DDR4" +CONFIG_ARM=y +CONFIG_TARGET_LS1043ARDB=y
include/configs/ls1043a_common.h +30 -0
@@ -60,6 +60,36 @@#define CONFIG_BAUDRATE 115200#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } +/* SD boot SPL */ +#ifdef CONFIG_SD_BOOT +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds" +#define CONFIG_SPL_TARGET "u-boot-with-spl.bin" +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_ENV_SUPPORT +#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT +#define CONFIG_SPL_WATCHDOG_SUPPORT +#define CONFIG_SPL_I2C_SUPPORT +#define CONFIG_SPL_SERIAL_SUPPORT +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT +#define CONFIG_SPL_MMC_SUPPORT +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0xf0 +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x500 + +#define CONFIG_SPL_TEXT_BASE 0x10000000 +#define CONFIG_SPL_MAX_SIZE 0x1d000 +#define CONFIG_SPL_STACK 0x1001e000 +#define CONFIG_SPL_PAD_TO 0x1d000 + +#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_TEXT_BASE + \ + CONFIG_SYS_MONITOR_LEN) +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 +#define CONFIG_SPL_BSS_START_ADDR 0x80100000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 +#define CONFIG_SYS_MONITOR_LEN 0xa0000 +#endif +/* NAND SPL */ #ifdef CONFIG_NAND_BOOT #define CONFIG_SPL_PBL_PAD
include/configs/ls1043ardb.h +11 -2
@@ -12,7 +12,7 @@#define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#if defined(CONFIG_NAND_BOOT ) +#if defined(CONFIG_NAND_BOOT ) || defined(CONFIG_SD_BOOT )#define CONFIG_SYS_TEXT_BASE 0x82000000#else #define CONFIG_SYS_TEXT_BASE 0x60100000
@@ -45,6 +45,10 @@#define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg#endif +#ifdef CONFIG_SD_BOOT +#define CONFIG_SYS_FSL_PBL_RCW board/freescale/ls1043ardb/ls1043ardb_rcw_sd.cfg +#endif +/* * NOR Flash Definitions */
@@ -217,7 +221,12 @@*/ #define CONFIG_ENV_OVERWRITE -#if defined(CONFIG_NAND_BOOT ) +#if defined(CONFIG_SD_BOOT ) +#define CONFIG_ENV_OFFSET (1024 * 1024) +#define CONFIG_ENV_IS_IN_MMC +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_ENV_SIZE 0x2000 +#elif defined(CONFIG_NAND_BOOT )#define CONFIG_ENV_IS_IN_NAND #define CONFIG_ENV_SIZE 0x2000#define CONFIG_ENV_OFFSET (10 * CONFIG_SYS_NAND_BLOCK_SIZE)
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 16/16 armv8/ls1043ardb: Add cpld command to boot from sd
In reply to Gong Qianyu--- board/freescale/ls1043ardb/cpld.c | 17 +++++++++++++++++ board/freescale/ls1043ardb/cpld.h | 1 + 2 files changed, 18 insertions(+)
board/freescale/ls1043ardb/cpld.c +17 -0
@@ -60,6 +60,20 @@ void cpld_set_nand(void)CPLD_WRITE (system_rst,1 ); } +void cpld_set_sd (void ) +{ +u16 reg =CPLD_CFG_RCW_SRC_SD ; +u8 reg5 = (u8)(reg >>1 ); +u8 reg6 = (u8)(reg &1 ); +cpld_rev_bit (®5); + +CPLD_WRITE (soft_mux_on,1 ); + +CPLD_WRITE (cfg_rcw_src1, reg5); +CPLD_WRITE (cfg_rcw_src2, reg6); + +CPLD_WRITE (system_rst,1 ); +}#ifdef DEBUG static void cpld_dump_regs (void ) {
@@ -108,6 +122,8 @@ int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])cpld_set_altbank (); else if (strcmp(argv[2], "nand") == 0) cpld_set_nand(); + else if (strcmp(argv[2], "sd") == 0) + cpld_set_sd(); elsecpld_set_defbank ();#ifdef DEBUG
@@ -127,6 +143,7 @@ U_BOOT_CMD("reset: reset to default bank\n" "cpld reset altbank: reset to alternate bank\n" "cpld reset nand: reset to boot from NAND flash\n" +"cpld reset sd: reset to boot from SD card\n" #ifdef DEBUG"cpld dump - display the CPLD registers\n" #endif
board/freescale/ls1043ardb/cpld.h +1 -0
@@ -41,4 +41,5 @@ void cpld_rev_bit(unsigned char *value);#define CPLD_BANK_SEL_MASK 0x07#define CPLD_BANK_SEL_ALTBANK 0x04#define CPLD_CFG_RCW_SRC_NAND 0x106 +#define CPLD_CFG_RCW_SRC_SD 0x040#endif
Signature · 1 line
2.1.0.27.g96db324
PATCH v2 16/16 armv8/ls1043ardb: Add cpld command to boot from sd
Quoted 5 lines · Gong Qianyu
Signed-off-by Gong Qianyu <[email protected]>--- board/freescale/ls1043ardb/cpld.c | 17 +++++++++++++++++ board/freescale/ls1043ardb/cpld.h | 1 + 2 files changed, 18 insertions(+)
Squash this patch with SD boot patch.
York