armv8/fsl-lsch3: Add Freescale Debug Server driver
Subsystems (7)
PATCH 1/8 armv8/fsl-lsch3: Add Freescale Debug Server driver
From: Bhupesh Sharma <[email protected]>
The Debug Server driver is responsible for loading the Debug server FW on the Service Processor (Cortex-A5 core) on LS2085A like SoCs and then polling for the successful initialization of the same. TOP MEM HIDE is adjusted to ensure the space required by Debug Server FW is accounted for. MC uses the DDR area which is calculated as:
MC DDR region start = Top of DDR - area reserved by Debug Server FW
--- arch/arm/cpu/armv8/fsl-lsch3/cpu.c | 2 +- arch/arm/include/asm/arch-fsl-lsch3/config.h | 10 +- board/freescale/ls2085a/ls2085a.c | 29 +++ drivers/misc/Makefile | 1 + drivers/misc/fsl_debug_server.c | 246 ++++++++++++++++++++++++++ drivers/net/fsl-mc/mc.c | 4 + include/configs/ls2085a_common.h | 20 ++- include/fsl-mc/fsl_mc.h | 1 + include/fsl_debug_server.h | 32 ++++ 9 files changed, 338 insertions(+), 7 deletions(-) create mode 100644 drivers/misc/fsl_debug_server.c create mode 100644 include/fsl_debug_server.h
arch/arm/cpu/armv8/fsl-lsch3/cpu.c +1 -1
@@ -10,6 +10,7 @@#include <asm/armv8/mmu.h> #include <asm/io.h> #include <asm/arch-fsl-lsch3/immap_lsch3.h> +#include <fsl_debug_server.h> #include <fsl-mc/fsl_mc.h> #include "cpu.h" #include "mp.h"
@@ -384,7 +385,6 @@ int cpu_eth_init(bd_t *bis)return error; } -int arch_early_init_r (void ) {int rv;
arch/arm/include/asm/arch-fsl-lsch3/config.h +9 -1
@@ -30,6 +30,15 @@#define CONFIG_SYS_FSL_PMU_CLTBENR (CONFIG_SYS_FSL_PMU_ADDR + \ 0x18A0) +/* SP (Cortex-A5) related */ +#define CONFIG_SYS_FSL_SP_ADDR (CONFIG_SYS_IMMR + 0x00F00000) +#define CONFIG_SYS_FSL_SP_VSG_GIC_ADDR (CONFIG_SYS_FSL_SP_ADDR) +#define CONFIG_SYS_FSL_SP_VSG_GIC_VIGR1 (CONFIG_SYS_FSL_SP_ADDR) +#define CONFIG_SYS_FSL_SP_VSG_GIC_VIGR2 \ + (CONFIG_SYS_FSL_SP_ADDR + 0x0008) +#define CONFIG_SYS_FSL_SP_LOOPBACK_DUART \ + (CONFIG_SYS_FSL_SP_ADDR + 0x1000) +#define CONFIG_SYS_FSL_DCSR_DDR_ADDR 0x70012c000ULL#define CONFIG_SYS_FSL_DCSR_DDR2_ADDR 0x70012d000ULL#define CONFIG_SYS_FSL_DCSR_DDR3_ADDR 0x700132000ULL
@@ -88,7 +97,6 @@#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_LS2_DDR_BLOCK1_SIZE#define CONFIG_SYS_FSL_DDR_VER FSL_DDR_VER_5_0 -/* IFC */ #define CONFIG_SYS_FSL_IFC_LE
board/freescale/ls2085a/ls2085a.c +29 -0
@@ -12,6 +12,7 @@#include <asm/io.h> #include <fdt_support.h> #include <libfdt.h> +#include <fsl_debug_server.h> #include <fsl-mc/fsl_mc.h> #include <environment.h>
@@ -79,6 +80,34 @@ void reset_cpu(ulong addr) { } +#if defined(CONFIG_ARCH_MISC_INIT ) +int arch_misc_init (void ) +{ +#ifdef CONFIG_FSL_DEBUG_SERVER +debug_server_init (); +#endif + +return 0 ; +} +#endif + +unsigned long get_dram_size_to_hide (void ) +{ +unsigned long dram_to_hide =0 ; + +/* Carve the Debug Server private DRAM block from the end of DRAM */ +#ifdef CONFIG_FSL_DEBUG_SERVER + dram_to_hide +=debug_server_get_dram_block_size (); +#endif + +/* Carve the MC private DRAM block from the end of DRAM */ +#ifdef CONFIG_FSL_MC_ENET + dram_to_hide +=mc_get_dram_block_size (); +#endif + +return dram_to_hide; +} +int board_eth_init (bd_t *bis) {int error =0 ;
drivers/misc/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpc.o obj-$(CONFIG_CROS_EC_I2C) += cros_ec_i2c.o obj-$(CONFIG_CROS_EC_SANDBOX) += cros_ec_sandbox.o obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o +obj-$(CONFIG_FSL_DEBUG_SERVER) += fsl_debug_server.o obj-$(CONFIG_FSL_IIM) += fsl_iim.o obj-$(CONFIG_GPIO_LED) += gpio_led.o obj-$(CONFIG_I2C_EEPROM) += i2c_eeprom.o
drivers/misc/fsl_debug_server.c new file +246 -0
246 lines not on this page · raw message
drivers/net/fsl-mc/mc.c +4 -0
@@ -9,6 +9,7 @@#include <fsl-mc/fsl_mc.h> #include <fsl-mc/fsl_mc_sys.h> #include <fsl-mc/fsl_dpmng.h> +#include <fsl_debug_server.h> DECLARE_GLOBAL_DATA_PTR ;static int mc_boot_status;
@@ -112,6 +113,9 @@ int mc_init(bd_t *bis) gd->bd->bi_dram[0 ].start + gd->bd->bi_dram[0 ].size; } +#ifdef CONFIG_FSL_DEBUG_SERVER + mc_ram_addr -=debug_server_get_dram_block_size (); +#endif /* * Management Complex cores should be held at reset out of POR. * U-boot should be the first software to touch MC. To be safe,
include/configs/ls2085a_common.h +15 -5
@@ -19,6 +19,9 @@#define CONFIG_ARM_ERRATA_828024 #define CONFIG_ARM_ERRATA_826974 +/* We need architecture specific misc initializations */ +#define CONFIG_ARCH_MISC_INIT +/* Link Definitions */ #define CONFIG_SYS_TEXT_BASE 0x30001000
@@ -206,6 +209,14 @@#define CONFIG_SYS_CS0_FTIM2 CONFIG_SYS_NOR_FTIM2#define CONFIG_SYS_CS0_FTIM3 CONFIG_SYS_NOR_FTIM3 +/* Debug Server firmware */ +#define CONFIG_FSL_DEBUG_SERVER +#define CONFIG_SYS_DEBUG_SERVER_DRAM_BLOCK_MIN_SIZE (512UL * 1024 * 1024) +#define CONFIG_SYS_DEBUG_SERVER_FW_IN_NOR +#define CONFIG_SYS_DEBUG_SERVER_FW_ADDR 0x580C00000ULL +/* 2 sec timeout */ +#define CONFIG_SYS_DEBUG_SERVER_TIMEOUT (2 * 1000 * 1000) +/* MC firmware */ #define CONFIG_FSL_MC_ENET #define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE (512UL * 1024 * 1024)
@@ -217,9 +228,9 @@#define CONFIG_SYS_LS_MC_DPL_MAX_LENGTH (256 * 1024)#define CONFIG_SYS_LS_MC_DRAM_DPL_OFFSET 0xe00000 -/* Carve the MC private DRAM block from the end of DRAM */ -#ifdef CONFIG_FSL_MC_ENET -#define CONFIG_SYS_MEM_TOP_HIDE mc_get_dram_block_size() +/* Carve out a DDR region which will not be used by u-boot/Linux */ +#if defined(CONFIG_FSL_MC_ENET ) || defined(CONFIG_FSL_DEBUG_SERVER ) +#define CONFIG_SYS_MEM_TOP_HIDE get_dram_size_to_hide()#endif /* Command line configuration */
@@ -251,7 +262,6 @@#define CONFIG_SYS_CLK_FREQ 100000000#define CONFIG_DDR_CLK_FREQ 133333333 -#define CONFIG_NR_DRAM_BANKS 3#define CONFIG_HWCONFIG
@@ -298,7 +308,7 @@#define CONFIG_SYS_MAXARGS 64/* max command args */ #ifndef __ASSEMBLY__ -unsigned long mc_get_dram_block_size (void ); +unsigned long get_dram_size_to_hide (void );#endif #endif /* __LS2_COMMON_H */
include/fsl-mc/fsl_mc.h +1 -0
@@ -56,4 +56,5 @@ struct mc_ccsr_registers {int mc_init (bd_t *bis);int get_mc_boot_status (void ); +unsigned long mc_get_dram_block_size (void );#endif
include/fsl_debug_server.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright (C) 2014 Freescale Semiconductor +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __FSL_DBG_SERVER_H__ +#define __FSL_DBG_SERVER_H__ + +#include <asm/io.h> +#include <common.h> + +/* +* Define Debug Server firmware version information +*/ + +/* Major version number: incremented on API compatibility changes */ +#define DEBUG_SERVER_VER_MAJOR 0 + +/* Minor version number: incremented on API additions (backward +* compatible); reset when major version is incremented. +*/ +#define DEBUG_SERVER_VER_MINOR 1 + +#define DEBUG_SERVER_INIT_STATUS (1 << 0) +#define DEBUG_SERVER_INIT_STATUS_MASK (0x00000001) + +int debug_server_init (void ); +unsigned long debug_server_get_dram_block_size (void ); + +#endif /* __FSL_DBG_SERVER_H__ */ +
Signature · 1 line
1.7.9.5
PATCH 1/8 armv8/fsl-lsch3: Add Freescale Debug Server driver
Quoted 8 lines · York Sun
From: Bhupesh Sharma <[email protected]>
The Debug Server driver is responsible for loading the Debug server FW on the Service Processor (Cortex-A5 core) on LS2085A like SoCs and then polling for the successful initialization of the same. TOP MEM HIDE is adjusted to ensure the space required by Debug Server FW is accounted for. MC uses the DDR area which is calculated as:
Quoted 4 lines
MC DDR region start = Top of DDR - area reserved by Debug Server FW
Signed-off-by Bhupesh Sharma <[email protected]>---
This set is to fsl-qoriq master, awaiting upstream.
[U-Boot,1/8] armv8/fsl-lsch3: Add Freescale Debug Server driver [U-Boot,2/8] fsl-ch3/README: Add description for NOR flash layout (firmware images) [U-Boot,3/8] driver/fsl-mc: Add support of MC Flibs
[U-Boot,4/8] driver/ldpaa_eth: Add LDPAA Ethernet driver
[U-Boot,5/8] board/ls2085_common: Increase malloc length
[U-Boot,6/8] driver/fsl_ifc: Add support to finalize CS1, CS3 address binding [U-Boot,7/8] nand/fsl_ifc: Increase eccstat[] for IFC 2.0 [U-Boot,v2,8/8] driver/i2c/mxc: Enable I2C bus 3 and 4
York
PATCH 2/8 fsl-ch3/README: Add description for NOR flash layout (firmware images)
In reply to York SunFrom: Bhupesh Sharma <[email protected]>
This patch adds description for NOR flash layout (firmware images) in the README file for LS2085A platforms.
--- arch/arm/cpu/armv8/fsl-lsch3/README | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
arch/arm/cpu/armv8/fsl-lsch3/README +25 -0
@@ -8,3 +8,28 @@ Freescale LayerScape with Chassis Generation 3 This architecture supports Freescale ARMv8 SoCs with Chassis generation 3, for example LS2085A. + +Flash Layout +============ +A typical layout of various images (including Linux and other firmware images) +is shown below considering a 32MB NOR flash device: + + ------------------------- + | linux | + ------------------------- ----> 0x0120_0000 + | Debug Server | + ------------------------- ----> 0x00C0_0000 + | AIOP SW | + ------------------------- ----> 0x0070_0000 + | MC FW | + ------------------------- ----> 0x006C_0000 + | MC Data Path Layout | + ------------------------- ----> 0x0020_0000 + | BootLoader | + ------------------------- ----> 0x0000_1000 + | PBI | + ------------------------- ----> 0x0000_0080 + | RCW | + ------------------------- ----> 0x0000_0000 + + 32-MB NOR flash layout
Signature · 1 line
1.7.9.5
PATCH 3/8 driver/fsl-mc: Add support of MC Flibs
In reply to York SunFrom: Prabhakar Kushwaha <[email protected]>
Freescale's Layerscape Management Complex (MC) provide support various objects like DPRC, DPNI, DPBP and DPIO.
Where:
DPRC: Place holdes for other MC objectes like DPNI, DPBP, DPIO
DPBP: Management of buffer pool
DPIO: Used for used to QBMan portal
DPNI: Represents standard network interface
These objects are used for DPAA ethernet drivers.
---
arch/arm/cpu/armv8/fsl-lsch3/cpu.c | 2 +-
arch/arm/include/asm/arch-fsl-lsch3/config.h | 2 +
board/freescale/ls2085a/ls2085a.c | 1 +
drivers/net/fsl-mc/Makefile | 6 +-
drivers/net/fsl-mc/dpbp.c | 102 +++
drivers/net/fsl-mc/{ => dpio}/Makefile | 7 +-
drivers/net/fsl-mc/dpio/dpio.c | 102 +++
drivers/net/fsl-mc/dpio/qbman_portal.c | 593 ++++++++++++++
drivers/net/fsl-mc/dpio/qbman_portal.h | 157 ++++
drivers/net/fsl-mc/dpio/qbman_private.h | 169 ++++
drivers/net/fsl-mc/dpio/qbman_sys.h | 290 +++++++
drivers/net/fsl-mc/dpmng.c | 65 +-
drivers/net/fsl-mc/dpni.c | 506 ++++++++++++
drivers/net/fsl-mc/dprc.c | 283 +++++++
drivers/net/fsl-mc/fsl_dpmng_cmd.h | 32 +-
drivers/net/fsl-mc/mc.c | 230 +++++-
drivers/net/fsl-mc/mc_sys.c | 6 +-
include/fsl-mc/fsl_dpaa_fd.h | 121 +++
include/fsl-mc/fsl_dpbp.h | 143 ++++
include/fsl-mc/fsl_dpio.h | 163 ++++
include/fsl-mc/fsl_dpmng.h | 113 +--
include/fsl-mc/fsl_dpni.h | 1093 ++++++++++++++++++++++++++
include/fsl-mc/fsl_dprc.h | 659 ++++++++++++++++
include/fsl-mc/fsl_mc.h | 4 +-
include/fsl-mc/fsl_mc_cmd.h | 17 +-
include/fsl-mc/fsl_mc_private.h | 48 ++
include/fsl-mc/fsl_qbman_base.h | 87 ++
include/fsl-mc/fsl_qbman_portal.h | 175 +++++
28 files changed, 4961 insertions(+), 215 deletions(-)
create mode 100644 drivers/net/fsl-mc/dpbp.c
copy drivers/net/fsl-mc/{ => dpio}/Makefile (59%)
create mode 100644 drivers/net/fsl-mc/dpio/dpio.c
create mode 100644 drivers/net/fsl-mc/dpio/qbman_portal.c
create mode 100644 drivers/net/fsl-mc/dpio/qbman_portal.h
create mode 100644 drivers/net/fsl-mc/dpio/qbman_private.h
create mode 100644 drivers/net/fsl-mc/dpio/qbman_sys.h
create mode 100644 drivers/net/fsl-mc/dpni.c
create mode 100644 drivers/net/fsl-mc/dprc.c
create mode 100644 include/fsl-mc/fsl_dpaa_fd.h
create mode 100644 include/fsl-mc/fsl_dpbp.h
create mode 100644 include/fsl-mc/fsl_dpio.h
create mode 100644 include/fsl-mc/fsl_dpni.h
create mode 100644 include/fsl-mc/fsl_dprc.h
create mode 100644 include/fsl-mc/fsl_mc_private.h
create mode 100644 include/fsl-mc/fsl_qbman_base.h
create mode 100644 include/fsl-mc/fsl_qbman_portal.harch/arm/cpu/armv8/fsl-lsch3/cpu.c +1 -1
@@ -380,7 +380,7 @@ int cpu_eth_init(bd_t *bis)int error =0 ;#ifdef CONFIG_FSL_MC_ENET - error =mc_init (bis); + error =fsl_mc_ldpaa_init (bis);#endif return error; }
arch/arm/include/asm/arch-fsl-lsch3/config.h +2 -0
@@ -8,6 +8,8 @@#define _ASM_ARMV8_FSL_LSCH3_CONFIG_#include <fsl_ddrc_version.h> + +#define CONFIG_SYS_PAGE_SIZE 0x10000#define CONFIG_MP #define CONFIG_SYS_FSL_OCRAM_BASE 0x18000000/* initial RAM */ /* Link Definitions */
board/freescale/ls2085a/ls2085a.c +1 -0
@@ -164,6 +164,7 @@ int ft_board_setup(void *blob, bd_t *bd)#ifdef CONFIG_FSL_MC_ENET fdt_fixup_board_enet (blob); +fsl_mc_ldpaa_exit (bd);#endif return 0 ;
drivers/net/fsl-mc/Makefile +5 -1
@@ -7,4 +7,8 @@ # Layerscape MC driver obj-y += mc.o \ mc_sys.o \ - dpmng.o + dpmng.o \ + dprc.o \ + dpbp.o \ + dpni.o +obj-y += dpio/
drivers/net/fsl-mc/dpbp.c new file +102 -0
102 lines not on this page · raw message
drivers/net/fsl-mc/dpio/Makefile renamed from drivers/net/fsl-mc/Makefile +3 -4
@@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Layerscape MC driver -obj-y += mc.o \ - mc_sys.o \ - dpmng.o +# Layerscape MC DPIO driver +obj-y += dpio.o \ + qbman_portal.o
drivers/net/fsl-mc/dpio/dpio.c new file +102 -0
102 lines not on this page · raw message
drivers/net/fsl-mc/dpio/qbman_portal.c new file +593 -0
593 lines not on this page · raw message
drivers/net/fsl-mc/dpio/qbman_portal.h new file +157 -0
157 lines not on this page · raw message
drivers/net/fsl-mc/dpio/qbman_private.h new file +169 -0
169 lines not on this page · raw message
drivers/net/fsl-mc/dpio/qbman_sys.h new file +290 -0
290 lines not on this page · raw message
drivers/net/fsl-mc/dpmng.c +1 -64
71 lines not on this page · raw message
drivers/net/fsl-mc/dpni.c new file +506 -0
506 lines not on this page · raw message
drivers/net/fsl-mc/dprc.c new file +283 -0
283 lines not on this page · raw message
drivers/net/fsl-mc/fsl_dpmng_cmd.h +1 -31
@@ -1,4 +1,4 @@ -/* Copyright 2014 Freescale Semiconductor Inc. +/* Copyright 2013-2015 Freescale Semiconductor Inc. * * SPDX-License-Identifier: GPL-2.0+ */
@@ -7,10 +7,6 @@/* Command IDs */ #define DPMNG_CMDID_GET_VERSION 0x831 -#define DPMNG_CMDID_RESET_AIOP 0x832 -#define DPMNG_CMDID_LOAD_AIOP 0x833 -#define DPMNG_CMDID_RUN_AIOP 0x834 -#define DPMNG_CMDID_RESET_MC_PORTAL 0x835/* cmd, param, offset, width, type, arg_name */ #define DPMNG_RSP_GET_VERSION (cmd, mc_ver_info) \
@@ -20,30 +16,4 @@ do { \MC_RSP_OP (cmd,1 ,0 ,32 , uint32_t, mc_ver_info->minor); \ } while (0) -/* cmd, param, offset, width, type, arg_name */ -#define DPMNG_CMD_RESET_AIOP (cmd, container_id, aiop_tile_id) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, int, aiop_tile_id); \ - MC_CMD_OP(cmd, 0, 32, 32, int, container_id); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPMNG_CMD_LOAD_AIOP (cmd, container_id, aiop_tile_id, img_size, \ - img_iova) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, int, aiop_tile_id); \ - MC_CMD_OP(cmd, 0, 32, 32, int, container_id); \ - MC_CMD_OP(cmd, 1, 0, 32, uint32_t, img_size); \ - MC_CMD_OP(cmd, 2, 0, 64, uint64_t, img_iova); \ -} while (0) - -/* cmd, param, offset, width, type, arg_name */ -#define DPMNG_CMD_RUN_AIOP (cmd, container_id, aiop_tile_id, cfg) \ -do { \ - MC_CMD_OP(cmd, 0, 0, 32, int, aiop_tile_id); \ - MC_CMD_OP(cmd, 0, 32, 32, int, container_id); \ - MC_CMD_OP(cmd, 1, 0, 32, uint32_t, cfg->cores_mask); \ - MC_CMD_OP(cmd, 2, 0, 64, uint64_t, cfg->options); \ -} while (0) -#endif /* __FSL_DPMNG_CMD_H */
drivers/net/fsl-mc/mc.c +223 -7
268 lines not on this page · raw message
drivers/net/fsl-mc/mc_sys.c +3 -3
@@ -1,7 +1,7 @@/* * Freescale Layerscape MC I/O wrapper * -* Copyright (C) 2014 Freescale Semiconductor, Inc. +* Copyright (C) 2013-2015 Freescale Semiconductor, Inc. * Author: German Rivera <[email protected]> * * SPDX-License-Identifier: GPL-2.0+
@@ -32,7 +32,7 @@ int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd) {enum mc_cmd_status status; -int timeout =2000 ; +int timeout =6000 ;mc_write_command (mc_io->mmio_regs, cmd);
@@ -52,7 +52,7 @@ int mc_send_command(struct fsl_mc_io *mc_io,if (status !=MC_CMD_STATUS_OK ) {printf ("Error: MC command failed (portal: %p, obj handle: %#x, command: %#x, status: %#x)\n" , mc_io->mmio_regs, - (unsigned int )MC_CMD_HDR_READ_AUTHID (cmd->header), + (unsigned int )MC_CMD_HDR_READ_TOKEN (cmd->header), (unsigned int )MC_CMD_HDR_READ_CMDID (cmd->header), (unsigned int )status);
include/fsl-mc/fsl_dpaa_fd.h new file +121 -0
121 lines not on this page · raw message
include/fsl-mc/fsl_dpbp.h new file +143 -0
143 lines not on this page · raw message
include/fsl-mc/fsl_dpio.h new file +163 -0
84 lines not on this page · raw message
include/fsl-mc/fsl_dpmng.h +18 -95
113 lines not on this page · raw message
include/fsl-mc/fsl_dpni.h new file +1093 -0
1,093 lines not on this page · raw message
include/fsl-mc/fsl_dprc.h new file +659 -0
659 lines not on this page · raw message
include/fsl-mc/fsl_mc_private.h new file +48 -0
48 lines not on this page · raw message
include/fsl-mc/fsl_qbman_base.h new file +87 -0
87 lines not on this page · raw message
include/fsl-mc/fsl_qbman_portal.h new file +175 -0
175 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.9.5
Part of the diff is not shown here. View the raw message.
PATCH 4/8 driver/ldpaa_eth: Add LDPAA Ethernet driver
In reply to York SunFrom: Prabhakar Kushwaha <[email protected]>
LDPAA Ethernet driver is a freescale's new ethernet driver based on Layerscape architecture.
Every ethernet driver controls on DPNI object. Where all DPNIs share one common DPBP and DPIO object to support Rx and Tx flows.
---
arch/arm/include/asm/arch-fsl-lsch3/config.h | 6 +
drivers/net/Makefile | 1 +
drivers/net/fsl-mc/mc.c | 16 +-
drivers/net/{fsl-mc/dpio => ldpaa_eth}/Makefile | 5 +-
drivers/net/ldpaa_eth/ldpaa_eth.c | 695 +++++++++++++++++++++++
drivers/net/ldpaa_eth/ldpaa_eth.h | 153 +++++
include/fsl-mc/fsl_mc_private.h | 2 +
7 files changed, 872 insertions(+), 6 deletions(-)
copy drivers/net/{fsl-mc/dpio => ldpaa_eth}/Makefile (59%)
create mode 100644 drivers/net/ldpaa_eth/ldpaa_eth.c
create mode 100644 drivers/net/ldpaa_eth/ldpaa_eth.harch/arm/include/asm/arch-fsl-lsch3/config.h +6 -0
@@ -10,6 +10,12 @@#include <fsl_ddrc_version.h> #define CONFIG_SYS_PAGE_SIZE 0x10000 + +#ifndef L1_CACHE_BYTES +#define L1_CACHE_SHIFT 6 +#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) +#endif +#define CONFIG_MP #define CONFIG_SYS_FSL_OCRAM_BASE 0x18000000/* initial RAM */ /* Link Definitions */
drivers/net/Makefile +1 -0
@@ -65,4 +65,5 @@ obj-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \ xilinx_ll_temac_fifo.o xilinx_ll_temac_sdma.o obj-$(CONFIG_ZYNQ_GEM) += zynq_gem.o obj-$(CONFIG_FSL_MC_ENET) += fsl-mc/ +obj-$(CONFIG_FSL_MC_ENET) += ldpaa_eth/ obj-$(CONFIG_VSC9953) += vsc9953.o
drivers/net/fsl-mc/mc.c +13 -3
@@ -397,9 +397,10 @@ int dpbp_init(struct dprc_obj_desc obj_desc)return 0 ; } -int dprc_init_container_obj (struct dprc_obj_desc obj_desc) +int dprc_init_container_obj (struct dprc_obj_desc obj_desc,uint16_t dprc_handle) { -int error =0 ; +int error =0 , state =0 ; +struct dprc_endpoint dpni_endpoint, dpmac_endpoint;if (!strcmp (obj_desc.type,"dpbp" )) {if (!dflt_dpbp) { error =dpbp_init (obj_desc);
@@ -412,6 +413,15 @@ int dprc_init_container_obj(struct dprc_obj_desc obj_desc)if (error <0 )printf ("dpio_init failed\n" ); } + }else if (!strcmp (obj_desc.type,"dpni" )) { +strcpy (dpni_endpoint.type, obj_desc.type); + dpni_endpoint.id = obj_desc.id; + error =dprc_get_connection (dflt_mc_io, dprc_handle, + &dpni_endpoint, &dpmac_endpoint, &state); +if (!strcmp (dpmac_endpoint.type,"dpmac" )) + error =ldpaa_eth_init (obj_desc); +if (error <0 ) +printf ("ldpaa_eth_init failed\n" ); }return error;
@@ -436,7 +446,7 @@ int dprc_scan_container_obj(uint16_t dprc_handle, char *obj_type, int i)debug ("Discovered object: type %s, id %d, req %s\n" , obj_desc.type, obj_desc.id, obj_type); - error =dprc_init_container_obj (obj_desc); + error =dprc_init_container_obj (obj_desc, dprc_handle);if (error <0 ) {printf ("dprc_init_container_obj(i=%d) failed: %d\n" , i, error);
drivers/net/ldpaa_eth/Makefile renamed from drivers/net/fsl-mc/dpio/Makefile +2 -3
@@ -4,6 +4,5 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Layerscape MC DPIO driver -obj-y += dpio.o \ - qbman_portal.o +# Layerscape LDPAA driver +obj-y += ldpaa_eth.o
drivers/net/ldpaa_eth/ldpaa_eth.c new file +695 -0
695 lines not on this page · raw message
drivers/net/ldpaa_eth/ldpaa_eth.h new file +153 -0
153 lines not on this page · raw message
include/fsl-mc/fsl_mc_private.h +2 -0
@@ -16,6 +16,7 @@#include <fsl-mc/fsl_mc_sys.h> #include <fsl-mc/fsl_mc_cmd.h> +#include <fsl-mc/fsl_dprc.h> #include <fsl-mc/fsl_dpbp.h> extern struct fsl_mc_io *dflt_mc_io;
@@ -45,4 +46,5 @@ struct fsl_dpio_obj {extern struct fsl_dpio_obj *dflt_dpio;int mc_init (void ); +int ldpaa_eth_init (struct dprc_obj_desc obj_desc);#endif /* _FSL_MC_PRIVATE_H_ */
Signature · 1 line
1.7.9.5
PATCH 5/8 board/ls2085_common: Increase malloc length
In reply to York SunFrom: Prabhakar Kushwaha <[email protected]>
Increase malloc length for more than 2M.
Reviewed-on: http://git.am.freescale.net:8181/26580
--- include/configs/ls2085a_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/ls2085a_common.h +1 -1
@@ -78,7 +78,7 @@#define COUNTER_FREQUENCY 12000000/* 12MHz */ /* Size of malloc() pool */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2048 * 1024)/* I2C */ #define CONFIG_CMD_I2C
Signature · 1 line
1.7.9.5
PATCH 6/8 driver/fsl_ifc: Add support to finalize CS1, CS3 address binding
In reply to York SunFrom: Prabhakar Kushwaha <[email protected]>
For fsl-lsch3, IFC is binded with address within 32-bit at fist. After u-boot relocates to DDR, CS1, CS3 can be binded to higher address to support large space.
--- drivers/misc/fsl_ifc.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/misc/fsl_ifc.c +9 -0
@@ -168,4 +168,13 @@ void init_final_memctl_regs(void)#ifdef CONFIG_SYS_CSPR0_FINAL set_ifc_cspr (IFC_CS0 ,CONFIG_SYS_CSPR0_FINAL );#endif +#ifdef CONFIG_SYS_CSPR1_FINAL +set_ifc_cspr (IFC_CS1 ,CONFIG_SYS_CSPR1_FINAL ); +#endif +#ifdef CONFIG_SYS_AMASK1_FINAL +set_ifc_amask (IFC_CS1 ,CONFIG_SYS_AMASK1_FINAL ); +#endif +#ifdef CONFIG_SYS_CSPR3_FINAL +set_ifc_cspr (IFC_CS3 ,CONFIG_SYS_CSPR3_FINAL ); +#endif }
Signature · 1 line
1.7.9.5
PATCH 7/8 nand/fsl_ifc: Increase eccstat[] for IFC 2.0
In reply to York SunFrom: Scott Wood <[email protected]>
IFC 2.0 doubled the SRAM size, which means double the number of ECCSTAT registers. Fix the resulting array overflow.
--- drivers/mtd/nand/fsl_ifc_nand.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/mtd/nand/fsl_ifc_nand.c +9 -2
@@ -292,7 +292,7 @@ static int fsl_ifc_run_command(struct mtd_info *mtd)struct fsl_ifc *ifc = ctrl->regs;u32 timeo = (CONFIG_SYS_HZ *10 ) /1000 ;u32 time_start; -u32 eccstat[4 ] = {0 }; +u32 eccstat[8 ] = {0 };int i;/* set the chip select for NAND Transaction */
@@ -325,8 +325,15 @@ static int fsl_ifc_run_command(struct mtd_info *mtd)int sector = bufnum * chip->ecc.steps;int sector_end = sector + chip->ecc.steps -1 ; -for (i = sector /4 ; i <= sector_end /4 ; i++) +for (i = sector /4 ; i <= sector_end /4 ; i++) { +if (i >=ARRAY_SIZE (eccstat)) { +printf ("%s: eccstat too small for %d\n" , + __func__, i); +return -EIO ; + } + eccstat[i] =ifc_in32 (&ifc->ifc_nand.nand_eccstat[i]); + }for (i = sector; i <= sector_end; i++) { errors =check_read_ecc (mtd, ctrl, eccstat, i);
Signature · 1 line
1.7.9.5
PATCH 8/8 driver/i2c/mxc: Add I2C3 and I2C4 for LS2085A
In reply to York SunLS2085A uses mxc I2C driver and has four I2C buses.
--- drivers/i2c/mxc_i2c.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/i2c/mxc_i2c.c +15 -1
@@ -114,6 +114,9 @@ static u16 i2c_clk_div[50][2] = {#ifndef CONFIG_SYS_MXC_I2C3_SPEED #define CONFIG_SYS_MXC_I2C3_SPEED 100000#endif +#ifndef CONFIG_SYS_MXC_I2C4_SPEED +#define CONFIG_SYS_MXC_I2C4_SPEED 100000 +#endif #ifndef CONFIG_SYS_MXC_I2C1_SLAVE #define CONFIG_SYS_MXC_I2C1_SLAVE 0
@@ -124,6 +127,9 @@ static u16 i2c_clk_div[50][2] = {#ifndef CONFIG_SYS_MXC_I2C3_SLAVE #define CONFIG_SYS_MXC_I2C3_SLAVE 0#endif +#ifndef CONFIG_SYS_MXC_I2C4_SLAVE +#define CONFIG_SYS_MXC_I2C4_SLAVE 0 +#endif /*
@@ -545,10 +551,18 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe, CONFIG_SYS_MXC_I2C2_SLAVE, 1)#if defined(CONFIG_MX31 ) || defined(CONFIG_MX35 ) ||\ defined(CONFIG_MX51 ) || defined(CONFIG_MX53 ) ||\ - defined(CONFIG_MX6 ) || defined(CONFIG_LS102XA ) + defined(CONFIG_MX6 ) || defined(CONFIG_LS102XA ) ||\ + defined(CONFIG_LS2085A )U_BOOT_I2C_ADAP_COMPLETE (mxc2, mxc_i2c_init, mxc_i2c_probe, mxc_i2c_read, mxc_i2c_write, mxc_i2c_set_bus_speed,CONFIG_SYS_MXC_I2C3_SPEED , CONFIG_SYS_MXC_I2C3_SLAVE, 2)#endif +#ifdef CONFIG_LS2085A +U_BOOT_I2C_ADAP_COMPLETE (mxc3, mxc_i2c_init, mxc_i2c_probe, + mxc_i2c_read, mxc_i2c_write, + mxc_i2c_set_bus_speed, +CONFIG_SYS_MXC_I2C4_SPEED , + CONFIG_SYS_MXC_I2C4_SLAVE, 3) +#endif
Signature · 1 line
1.7.9.5
PATCH 8/8 driver/i2c/mxc: Add I2C3 and I2C4 for LS2085A
Hello Yrok,
Am 19.03.2015 17:20, schrieb York Sun:
Quoted 42 lines
LS2085A uses mxc I2C driver and has four I2C buses.
Signed-off-by York Sun <[email protected]>CC Heiko Schocher <[email protected]>--- drivers/i2c/mxc_i2c.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)drivers/i2c/mxc_i2c.c +8
-1@@ -114,6 +114,9 @@ static u16 i2c_clk_div[50][2] = {#ifndef CONFIG_SYS_MXC_I2C3_SPEED #define CONFIG_SYS_MXC_I2C3_SPEED 100000#endif +#ifndef CONFIG_SYS_MXC_I2C4_SPEED +#define CONFIG_SYS_MXC_I2C4_SPEED 100000 +#endif #ifndef CONFIG_SYS_MXC_I2C1_SLAVE #define CONFIG_SYS_MXC_I2C1_SLAVE 0@@ -124,6 +127,9 @@ static u16 i2c_clk_div[50][2] = {#ifndef CONFIG_SYS_MXC_I2C3_SLAVE #define CONFIG_SYS_MXC_I2C3_SLAVE 0#endif +#ifndef CONFIG_SYS_MXC_I2C4_SLAVE +#define CONFIG_SYS_MXC_I2C4_SLAVE 0 +#endif /* @@ -545,10 +551,18 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe, CONFIG_SYS_MXC_I2C2_SLAVE, 1)#if defined(CONFIG_MX31 ) || defined(CONFIG_MX35 ) ||\ defined(CONFIG_MX51 ) || defined(CONFIG_MX53 ) ||\ - defined(CONFIG_MX6 ) || defined(CONFIG_LS102XA ) + defined(CONFIG_MX6 ) || defined(CONFIG_LS102XA ) ||\ + defined(CONFIG_LS2085A ) U_BOOT_I2C_ADAP_COMPLETE(mxc2, mxc_i2c_init, mxc_i2c_probe, mxc_i2c_read, mxc_i2c_write, mxc_i2c_set_bus_speed,
drivers/i2c/mxc_i2c.c U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe, · line 568
Quoted 10 lines
drivers/i2c/mxc_i2c.c +7
-0CONFIG_SYS_MXC_I2C3_SPEED, CONFIG_SYS_MXC_I2C3_SLAVE, 2)#endif +#ifdef CONFIG_LS2085A +U_BOOT_I2C_ADAP_COMPLETE (mxc3, mxc_i2c_init, mxc_i2c_probe, + mxc_i2c_read, mxc_i2c_write, + mxc_i2c_set_bus_speed, +CONFIG_SYS_MXC_I2C4_SPEED , + CONFIG_SYS_MXC_I2C4_SLAVE, 3) +#endif
Dummy question ... CONFIG_LS2085A (and CONFIG_LS102XA) are board spezific defines, right?
If so, I do not want them in driver specific code... because every board which uses this driver has to add here more defines.
Could you introduce a SoC or at least a driver specific define here? Maybe CONFIG_SYS_I2C_MXC_I2C4 if no SoC specific code is possible ...
Thanks!
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH 8/8 driver/i2c/mxc: Add I2C3 and I2C4 for LS2085A
Quoted 59 lines · Heiko Schocher
Hello Yrok,
Am 19.03.2015 17:20, schrieb York Sun:
Quoted 42 lines
LS2085A uses mxc I2C driver and has four I2C buses.
Signed-off-by York Sun <[email protected]>CC Heiko Schocher <[email protected]>--- drivers/i2c/mxc_i2c.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)drivers/i2c/mxc_i2c.c +8
-1@@ -114,6 +114,9 @@ static u16 i2c_clk_div[50][2] = {#ifndef CONFIG_SYS_MXC_I2C3_SPEED #define CONFIG_SYS_MXC_I2C3_SPEED 100000#endif +#ifndef CONFIG_SYS_MXC_I2C4_SPEED +#define CONFIG_SYS_MXC_I2C4_SPEED 100000 +#endif #ifndef CONFIG_SYS_MXC_I2C1_SLAVE #define CONFIG_SYS_MXC_I2C1_SLAVE 0@@ -124,6 +127,9 @@ static u16 i2c_clk_div[50][2] = {#ifndef CONFIG_SYS_MXC_I2C3_SLAVE #define CONFIG_SYS_MXC_I2C3_SLAVE 0#endif +#ifndef CONFIG_SYS_MXC_I2C4_SLAVE +#define CONFIG_SYS_MXC_I2C4_SLAVE 0 +#endif /* @@ -545,10 +551,18 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe, CONFIG_SYS_MXC_I2C2_SLAVE, 1)#if defined(CONFIG_MX31 ) || defined(CONFIG_MX35 ) ||\ defined(CONFIG_MX51 ) || defined(CONFIG_MX53 ) ||\ - defined(CONFIG_MX6 ) || defined(CONFIG_LS102XA ) + defined(CONFIG_MX6 ) || defined(CONFIG_LS102XA ) ||\ + defined(CONFIG_LS2085A ) U_BOOT_I2C_ADAP_COMPLETE(mxc2, mxc_i2c_init, mxc_i2c_probe, mxc_i2c_read, mxc_i2c_write, mxc_i2c_set_bus_speed,drivers/i2c/mxc_i2c.c U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe, · line 568
Quoted 10 lines
drivers/i2c/mxc_i2c.c +7
-0CONFIG_SYS_MXC_I2C3_SPEED, CONFIG_SYS_MXC_I2C3_SLAVE, 2)#endif +#ifdef CONFIG_LS2085A +U_BOOT_I2C_ADAP_COMPLETE (mxc3, mxc_i2c_init, mxc_i2c_probe, + mxc_i2c_read, mxc_i2c_write, + mxc_i2c_set_bus_speed, +CONFIG_SYS_MXC_I2C4_SPEED , + CONFIG_SYS_MXC_I2C4_SLAVE, 3) +#endif Dummy question ...
CONFIG_LS2085A(andCONFIG_LS102XA) are board spezific defines, right?
Quoted 7 lines
If so, I do not want them in driver specific code... because every board which uses this driver has to add here more defines.
Could you introduce a SoC or at least a driver specific define here? Maybe
CONFIG_SYS_I2C_MXC_I2C4if no SoC specific code is possible ...
Agree. Will fix in next version. Thanks.
York