Commit 9e189a1b authored by Wen-chien Jesse Sung's avatar Wen-chien Jesse Sung Committed by Thadeu Lima de Souza Cascardo
parent 01683e9f
......@@ -2,7 +2,7 @@
# Makefile for OpenNSL drivers
#
SDK=OpenNSL/sdk-6.4.10-gpl-modules
SDK=OpenNSL/sdk-6.5.10-gpl-modules
OP=ubuntu/opennsl/$(SDK)
ccflags-y += \
......@@ -25,6 +25,7 @@ linux-bcm-knet-objs := \
obj-$(CONFIG_OPENNSL_KERNEL_BDE) += linux-kernel-bde.o
linux-kernel-bde-objs := \
$(SDK)/systems/bde/linux/kernel/linux_dma.o \
$(SDK)/systems/bde/linux/kernel/linux-kernel-bde.o \
$(SDK)/systems/bde/linux/kernel/linux_shbde.o \
$(SDK)/systems/bde/linux/shared/mpool.o \
......
/*********************************************************************
*
* (C) Copyright Broadcom Corporation 2013-2016
* (C) Copyright Broadcom Corporation 2013-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -24,6 +24,8 @@
#ifndef DRIVER_H
#define DRIVER_H
#define OPENNSL_F_FAST_BOOT 0x00000001 /* Fast boot mode */
typedef struct opennsl_config_s
{
char *cfg_fname; /* Configuration file name along with the path */
......@@ -31,6 +33,9 @@ typedef struct opennsl_config_s
char *wb_fname; /* File to store warmboot configuration *
* along with the path */
char *rmcfg_fname; /* RM config file name along with the path */
char *cfg_post_fname; /* Post init configuration file name *
* along with the path */
unsigned int opennsl_flags; /* OpenNSL flags */
} opennsl_init_t;
/*****************************************************************//**
......@@ -43,6 +48,13 @@ typedef struct opennsl_config_s
********************************************************************/
extern int opennsl_driver_init(opennsl_init_t *init);
/*****************************************************************//**
* \brief Function to free up the resources and exit the driver
*
* \return OPENNSL_E_XXX OpenNSL API return code
********************************************************************/
extern int opennsl_driver_exit();
/**************************************************************************//**
* \brief To get platform boot flags
*
......@@ -50,6 +62,7 @@ extern int opennsl_driver_init(opennsl_init_t *init);
*****************************************************************************/
extern unsigned int opennsl_driver_boot_flags_get(void);
#ifdef INCLUDE_DIAG_SHELL
/*****************************************************************//**
* \brief Bringup diagnostic shell prompt and process the input commands.
*
......@@ -65,6 +78,19 @@ extern int opennsl_driver_shell();
* \return OPENNSL_E_XXX OpenNSL API return code
********************************************************************/
extern int opennsl_driver_process_command(char *commandBuf);
#endif
/*****************************************************************//**
* \brief Get a line from a user with editing
*
* \param prompt [IN] prompt string
*
* \return char* NULL, if the line is empty
* empty string, if the line is blank
* text of the line read, otherwise.
********************************************************************/
extern char *readline(const char *prompt);
extern void platform_phy_cleanup();
#endif /* DRIVER_H */
/**************************************************************************
*
* (C) Copyright Broadcom Corporation 2013-2016
* (C) Copyright Broadcom Limited 2013-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
......@@ -34,8 +34,20 @@
/* Size for giving to malloc and memset to handle _max bits */
#define SHR_BITALLOCSIZE(_max) (_SHR_BITDCLSIZE(_max) * sizeof (SHR_BITDCL))
/* (internal) Number of SHR_BITDCLs needed to contain from start bit to start bit + range */
#define _SHR_BITDCLSIZE_FROM_START_BIT(_start_bit, _range) (_range + _start_bit -1)/SHR_BITWID - _start_bit/SHR_BITWID + 1
/* Size of SHR_BITDCLs needed to contain from start bit to start bit + range.
Needed when you want to do autosync */
#define SHR_BITALLOCSIZE_FROM_START_BIT(_start_bit, _range) (_SHR_BITDCLSIZE_FROM_START_BIT(_start_bit, _range) * sizeof (SHR_BITDCL))
/* Declare bit array _n of size _max bits */
#define SHR_BITDCLNAME(_n, _max) SHR_BITDCL _n[_SHR_BITDCLSIZE(_max)]
/* Declare bit array _n of size _max bits, and clear it */
#define SHR_BIT_DCL_CLR_NAME(_n, _max) SHR_BITDCL _n[_SHR_BITDCLSIZE(_max)] = {0}
/* (internal) Generic operation macro on bit array _a, with bit _b */
#define _SHR_BITOP(_a, _b, _op) \
......@@ -45,6 +57,7 @@
#define SHR_BITGET(_a, _b) _SHR_BITOP(_a, _b, &)
#define SHR_BITSET(_a, _b) _SHR_BITOP(_a, _b, |=)
#define SHR_BITCLR(_a, _b) _SHR_BITOP(_a, _b, &= ~)
#define SHR_BITWRITE(_a, _b, _val) ((_val) ? SHR_BITSET(_a, _b) : SHR_BITCLR(_a, _b))
#define SHR_BIT_ITER(_a, _max, _b) \
for ((_b) = 0; (_b) < (_max); (_b)++) \
if ((_a)[(_b) / SHR_BITWID] == 0) \
......@@ -63,17 +76,17 @@ extern void shr_bitop_range_set(SHR_BITDCL *a, CONST int b, CONST int c);
(shr_bitop_range_set(_a, _b, _c))
/*
* Copy _e bits from bit array _c offset _d to bit array _a offset _b
* There should be no overlap between source _c and desstination _a
* _a[_b:_b + _e] = _c[_d:_d + _e]
* Copy _num_bits bits from bit array _src offset _src_offset to bit array _dest offset _dest_offset
* There should be no overlap between source _src and desstination _dest
* _dest[_dest_offset:_dest_offset + _num_bits] = _src[_src_offset:_src_offset + _num_bits]
*/
extern void shr_bitop_range_copy(SHR_BITDCL *a,
CONST int b,
CONST SHR_BITDCL *c,
CONST int d,
CONST int e);
#define SHR_BITCOPY_RANGE(_a, _b, _c, _d, _e) \
(shr_bitop_range_copy(_a, _b, _c, _d, _e))
#define SHR_BITCOPY_RANGE(_dest, _dest_offset,_src, _src_offset, _num_bits) \
(shr_bitop_range_copy(_dest, _dest_offset, _src, _src_offset, _num_bits))
/* Result is 0 only if all bits in the range are 0 */
#define SHR_BITTEST_RANGE(_bits, _first, _bit_count, _result) \
......
......@@ -87,6 +87,10 @@ extern char *_shr_errmsg[];
#define _SHR_E_IF_ERROR_RETURN(op) \
do { int __rv__; if ((__rv__ = (op)) < 0) { _SHR_ERROR_TRACE(__rv__); return(__rv__); } } while(0)
#define _SHR_E_IF_ERROR_CLEAN_RETURN(op,exop) \
do { int __rv__; if ((__rv__ = (op)) < 0) { _SHR_ERROR_TRACE(__rv__); (exop); return(__rv__); } } while(0)
#define _SHR_E_IF_ERROR_NOT_UNAVAIL_RETURN(op) \
do { \
int __rv__; \
......@@ -94,6 +98,8 @@ extern char *_shr_errmsg[];
return(__rv__); \
} \
} while(0)
typedef enum {
_SHR_SWITCH_EVENT_IO_ERROR = 1,
_SHR_SWITCH_EVENT_PARITY_ERROR = 2,
......@@ -112,6 +118,7 @@ typedef enum {
_SHR_SWITCH_EVENT_MMU_BST_TRIGGER = 15,
_SHR_SWITCH_EVENT_EPON_ALARM = 16,
_SHR_SWITCH_EVENT_RUNT_DETECT = 17,
_SHR_SWITCH_EVENT_AUTONEG_SPEED_ERROR = 18,
_SHR_SWITCH_EVENT_COUNT /* last, as always */
} _shr_switch_event_t;
......
/*********************************************************************
*
* (C) Copyright Broadcom Corporation 2013-2016
* (C) Copyright Broadcom Corporation 2013-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -90,7 +90,12 @@
*/
#ifndef _SHR_PBMP_WIDTH
#undef _SHR_PBMP_PORT_MAX
#ifndef OPENNSL_PRODUCT_DNX
#define _SHR_PBMP_PORT_MAX 256
#else
#define _SHR_PBMP_PORT_MAX 571
#endif
#define _SHR_PBMP_WIDTH (((_SHR_PBMP_PORT_MAX + 32 - 1)/32)*32)
#endif
......@@ -245,6 +250,10 @@ extern int _shr_pbmp_bmeq(_shr_pbmp_t *, _shr_pbmp_t *);
for ((port) = 0; (port) < _SHR_PBMP_PORT_MAX; (port)++) \
if (_SHR_PBMP_MEMBER((bm), (port)))
#define _SHR_PBMP_REVERSE_ITER(bm, port) \
for ((port) = _SHR_PBMP_PORT_MAX - 1; (port) > -1; (port)--) \
if (_SHR_PBMP_MEMBER((bm), (port)))
#define _SHR_PBMP_IS_NULL(bm) (_SHR_PBMP_BMNULL(bm))
#define _SHR_PBMP_NOT_NULL(bm) (!_SHR_PBMP_BMNULL(bm))
#define _SHR_PBMP_EQ(bma, bmb) (_SHR_PBMP_BMEQ(bma, bmb))
......@@ -259,6 +268,18 @@ extern int _shr_pbmp_bmeq(_shr_pbmp_t *, _shr_pbmp_t *);
#define _SHR_PBMP_NEGATE(bma, bmb) _SHR_PBMP_BMOP(bma, bmb, = ~)
/* Port PBMP operators */
#define _SHR_PBMP_FIRST(bm, first_port) \
do {\
_SHR_PBMP_ITER(bm, first_port) {break;} \
if (first_port == _SHR_PBMP_PORT_MAX) first_port = -1; \
} while(0)
#define _SHR_PBMP_LAST(bm, last_port) \
do {\
_SHR_PBMP_REVERSE_ITER(bm, last_port) {break;} \
} while(0)
#define _SHR_PBMP_ENTRY(bm, port) \
(_SHR_PBMP_WORD_GET(bm,_SHR_PBMP_WENT(port)))
#define _SHR_PBMP_MEMBER(bm, port) \
......@@ -277,4 +298,6 @@ extern char *_shr_pbmp_format(_shr_pbmp_t, char *);
#define _SHR_PBMP_FMT(bm, buf) _shr_pbmp_format(bm, buf)
#define _SHR_PBMP_FMT_LEN ((_SHR_PBMP_WORD_MAX*8)+3)
#define _SHR_PBMP_PORT_VALID(p) ((p) >= 0 && (p) < _SHR_PBMP_PORT_MAX)
#endif /* !_SHR_PBMP_H */
/*********************************************************************
*
* (C) Copyright Broadcom Corporation 2013-2016
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**********************************************************************
* File: pkt.h
* Details: This file defines for pkt module.
*
* Its contents are not used directly by applications;
* it is used only by header files of parent APIs which
* need to define PHY register definition.
*********************************************************************/
#ifndef _SHR_PKT_H
#define _SHR_PKT_H
#include <shared/types.h>
#include <shared/pbmp.h>
#include <shared/rx.h>
#include <shared/port.h>
#define _SHR_PKT_NOF_DNX_HEADERS 9
#define _SHR_PKT_DNX_RAW_SIZE_MAX 20
#endif /* _SHR_PKT_H */
/*********************************************************************
*
* (C) Copyright Broadcom Corporation 2013-2016
* (C) Copyright Broadcom Corporation 2013-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -115,6 +115,13 @@ typedef enum _shr_port_if_e {
_SHR_PORT_IF_LR2,
_SHR_PORT_IF_LRM,
_SHR_PORT_IF_XLPPI,
_SHR_PORT_IF_2500X,
_SHR_PORT_IF_SAT,
_SHR_PORT_IF_IPSEC,
_SHR_PORT_IF_LBG,
_SHR_PORT_IF_CAUI4,
_SHR_PORT_IF_5000X,
_SHR_PORT_IF_EVENTOR,
_SHR_PORT_IF_COUNT /* last, please */
} _shr_port_if_t;
......@@ -173,4 +180,51 @@ typedef enum _shr_port_medium_e {
_SHR_PORT_MEDIUM_COUNT /* last, please */
} _shr_port_medium_t;
/*
* Defines:
* _SHR_PORT_PHY_CONTROL_*
* Purpose:
* PHY specific control settings
*/
typedef enum _shr_port_phy_control_e {
_SHR_PORT_PHY_CONTROL_FORWARD_ERROR_CORRECTION = 74,
_SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS = 214,
_SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_LINK_WAIT_TIMER_US = 328,
_SHR_PORT_PHY_CONTROL_SOFTWARE_RX_LOS_RESTART_TIMER_US = 329
} _shr_port_phy_control_t;
/*
* Defines:
* _SHR_PORT_PRBS_POLYNOMIAL_*
* Purpose:
* PRBS polynomial type
*/
typedef enum _shr_port_prbs_polynomial_e {
_SHR_PORT_PRBS_POLYNOMIAL_X7_X6_1 = 0,
_SHR_PORT_PRBS_POLYNOMIAL_X15_X14_1 = 1,
_SHR_PORT_PRBS_POLYNOMIAL_X23_X18_1 = 2,
_SHR_PORT_PRBS_POLYNOMIAL_X31_X28_1 = 3,
_SHR_PORT_PRBS_POLYNOMIAL_X9_X5_1 = 4,
_SHR_PORT_PRBS_POLYNOMIAL_X11_X9_1 = 5,
_SHR_PORT_PRBS_POLYNOMIAL_X58_X31_1 = 6
} _shr_port_prbs_polynomial_t;
/*
* Defines:
* _SHR_PORT_PHY_CONTROL_FEC_*
* Purpose:
* PHY specific values for _SHR_PORT_PHY_CONTROL_FORWARD_ERROR_CORRECTION
*/
typedef enum _shr_port_phy_control_fec_e {
_SHR_PORT_PHY_CONTROL_FEC_OFF,
_SHR_PORT_PHY_CONTROL_FEC_ON,
_SHR_PORT_PHY_CONTROL_FEC_AUTO
} _shr_port_phy_control_fec_t;
typedef enum _shr_port_phy_control_rx_los_e {
_SHR_PORT_PHY_CONTROL_RX_LOS_NONE,
_SHR_PORT_PHY_CONTROL_RX_LOS_SOFTWARE,
_SHR_PORT_PHY_CONTROL_RX_LOS_FIRMWARE
} _shr_port_phy_control_rx_los_t;
#endif /* !_SHR_PORT_H */
/*********************************************************************
*
* (C) Copyright Broadcom Corporation 2013-2016
* (C) Copyright Broadcom Corporation 2013-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -36,9 +36,10 @@ typedef struct _shr_port_ability_s {
_shr_port_mode_t loopback;
_shr_port_mode_t flags;
_shr_port_mode_t eee;
_shr_port_mode_t fcmap;
_shr_port_mode_t rsvd;
_shr_pa_encap_t encap;
_shr_port_mode_t fec;
_shr_port_mode_t channel;
} _shr_port_ability_t;
#define _SHR_PA_ABILITY_ALL (0xffffffff)
......@@ -100,8 +101,9 @@ typedef struct _shr_port_ability_s {
* Defines for FEC abilities.
*/
#define _SHR_PA_FEC (1 << 0) /* FEC ability support */
#define _SHR_PA_FEC_REQUEST (1 << 1) /* FEC ability request */
#define _SHR_PA_FEC_NONE (1 << 0) /* FEC is not requested */
#define _SHR_PA_FEC_CL74 (1 << 1) /* FEC CL74 ability request */
#define _SHR_PA_FEC_CL91 (1 << 2) /* FEC Cl91 ability request */
/*
* Defines:
......@@ -118,6 +120,16 @@ typedef struct _shr_port_ability_s {
#define _SHR_PA_INTF_QSGMII (1 << 6) /* QSGMII mode supported */
#define _SHR_PA_INTF_CGMII (1 << 7) /* CGMII mode supported */
/*
* Defines:
* _SHR_PA_CHANNEL_*
* Purpose:
* Defines for CHANNEL abilities.
*/
#define _SHR_PA_CHANNEL_LONG (1 << 0) /* Channel is long */
#define _SHR_PA_CHANNEL_SHORT (1 << 1) /* Channel is short */
/*
* Defines:
* _SHR_PA_MEDIUM_*
......@@ -126,6 +138,7 @@ typedef struct _shr_port_ability_s {
*/
#define _SHR_PA_MEDIUM_COPPER (1 << 0)
#define _SHR_PA_MEDIUM_FIBER (1 << 1)
#define _SHR_PA_MEDIUM_BACKPLANE (1 << 2)
/*
* Defines:
......@@ -258,12 +271,4 @@ typedef struct _shr_port_ability_s {
#define _SHR_PA_EEE_10GB_KX4 (1 << 4) /* EEE for 10G-KX4 */
#define _SHR_PA_EEE_10GB_KR (1 << 5) /* EEE for 10G-KR */
#define _SHR_PA_FCMAP (1 << 0)
#define _SHR_PA_FCMAP_FCMAC_LOOPBACK (1 << 1)
#define _SHR_PA_FCMAP_AUTONEG (1 << 2)
#define _SHR_PA_FCMAP_2GB (1 << 3)
#define _SHR_PA_FCMAP_4GB (1 << 4)
#define _SHR_PA_FCMAP_8GB (1 << 5)
#define _SHR_PA_FCMAP_16GB (1 << 6)
#endif /* !_SHR_PORTABILITY_H */
/*********************************************************************
*
* (C) Copyright Broadcom Corporation 2013-2016
* (C) Copyright Broadcom Corporation 2013-2017
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -22,6 +22,7 @@
#ifndef _SHR_RX_H_
#define _SHR_RX_H_
#include <shared/types.h>
#include <shared/bitop.h>
/*
......@@ -135,7 +136,7 @@ typedef enum _shr_rx_reason_e {
_SHR_RX_L2_MARKED = 89, /* L2 table marked */
_SHR_RX_WLAN_SLOWPATH_KEEPALIVE = 90, /* WLAN slowpath to the CPU, */
/* otherwise dropped */
_SHR_RX_STATION = 91, /* MPLS sent to CPU */
_SHR_RX_STATION = 91, /* My Station packet to CPU */
_SHR_RX_NIV = 92, /* NIV packet */
_SHR_RX_NIV_PRIO_DROP = 93, /* NIV packet, priority drop */
_SHR_RX_NIV_INTERFACE_MISS = 94, /* NIV packet, interface miss */
......@@ -206,7 +207,51 @@ typedef enum _shr_rx_reason_e {
_SHR_RX_OAM_MPLS_LMDM = 155, /* MPLS LM/DM (RFC 6374) packet */
_SHR_RX_SAT = 156, /* OAM SAT pkt */
_SHR_RX_SAMPLE_SOURCE_FLEX = 157, /* Flexible sampled packets to CPU */
_SHR_RX_REASON_COUNT = 158 /* MUST BE LAST */
_SHR_RX_FLEX_SFLOW = 158, /* Flex Sflow? */
_SHR_RX_VXLT_MISS = 159, /* VLAN Translation miss packet */
_SHR_RX_TUNNEL_DECAP_ECN_ERROR = 160, /* Tunnel decap ECN error */
_SHR_RX_TUNNEL_OBJECT_VALIDATION_FAIL = 161, /* Tunnel Object Validation Fail */
_SHR_RX_L3_CPU = 162, /* L3 Copy to CPU */
_SHR_RX_TUNNEL_ADAPT_LOOKUP_MISS = 163, /* Tunnel Adapt Lookup Miss Drop */
_SHR_RX_PACKET_FLOW_SELECT_MISS = 164, /* Packet Flow Select Miss */
_SHR_RX_PROTECTION_DATA_DROP = 165, /* Protection Data Drop */
_SHR_RX_PACKET_FLOW_SELECT = 166, /* Packet Flow Select */
_SHR_RX_OTHER_LOOKUP_MISS = 167, /* Neither Source or Dest type of Lookup Miss */
_SHR_RX_INVALID_TPID = 168, /* Invalid TPID */
_SHR_RX_MPLS_CONTROL_PACKET = 169, /* MPLS Control Packet */
_SHR_RX_TUNNEL_TTL_ERROR = 170, /* Tunnel TTL Error */
_SHR_RX_L2_HEADER_ERROR = 171, /* L2 header */
_SHR_RX_OTHER_LOOKUP_HIT = 172, /* Neither Source or Dest type of Lookup Hit */
_SHR_RX_L2_SRC_LOOKUP_MISS = 173, /* L2 Source Lookup Miss */
_SHR_RX_L2_SRC_LOOKUP_HIT = 174, /* L2 Source Lookup Hit */
_SHR_RX_L2_DST_LOOKUP_MISS = 175, /* L2 Dest Lookup Miss */
_SHR_RX_L2_DST_LOOKUP_HIT = 176, /* L2 Dest Lookup Hit */
_SHR_RX_L3_SRC_ROUTE_LOOKUP_MISS = 177, /* L3 Source Route Lookup Miss */
_SHR_RX_L3_SRC_HOST_LOOKUP_MISS = 178, /* L3 Source Host Lookup Miss */
_SHR_RX_L3_SRC_ROUTE_LOOKUP_HIT = 179, /* L3 Source Route Lookup Hit */
_SHR_RX_L3_SRC_HOST_LOOKUP_HIT = 180, /* L3 Source Host Lookup Hit */
_SHR_RX_L3_DST_ROUTE_LOOKUP_MISS = 181, /* L3 Dest Route Lookup Miss */
_SHR_RX_L3_DST_HOST_LOOKUP_MISS = 182, /* L3 Dest Host Lookup Miss */
_SHR_RX_L3_DST_ROUTE_LOOKUP_HIT = 183, /* L3 Dest Route Lookup Hit */
_SHR_RX_L3_DST_HOST_LOOKUP_HIT = 184, /* L3 Dest Host Lookup Hit */
_SHR_RX_VLAN_TRANSLATE1_LOOKUP1_MISS = 185, /* VLAN Translate1 Lookup1 Miss */
_SHR_RX_VLAN_TRANSLATE1_LOOKUP2_MISS = 186, /* VLAN Translate1 Lookup2 Miss */
_SHR_RX_MPLS_LOOKUP1_MISS = 187, /* MPLS Lookup1 Miss */
_SHR_RX_MPLS_LOOKUP2_MISS = 188, /* MPLS Lookup2 Miss */
_SHR_RX_L3_TUNNEL_LOOKUP_MISS = 189, /* L3 Tunnel Lookup Miss */
_SHR_RX_VLAN_TRANSLATE2_LOOKUP1_MISS = 190, /* VLAN Translate2 Lookup1 Miss */
_SHR_RX_VLAN_TRANSLATE2_LOOKUP2_MISS = 191, /* VLAN Translate2 Lookup2 Miss */
_SHR_RX_L2_STU_FAIL = 192, /* L2 STU check fail */
_SHR_RX_SR_COUNTER_EXCEEDED = 193, /* Seamless Redundancy(SR) - */
/* Counter Threshold Exceeded */
_SHR_RX_SR_COPY_TO_CPU_BIT0 = 194, /* Seamless Redundancy(SR) copy to CPU */
/* SR custom reason code bit 0 */
_SHR_RX_SR_COPY_TO_CPU_BIT1 = 195, /* SR custom reason code bit 1 */
_SHR_RX_SR_COPY_TO_CPU_BIT2 = 196, /* SR custom reason code bit 2 */
_SHR_RX_SR_COPY_TO_CPU_BIT3 = 197, /* SR custom reason code bit 3 */
_SHR_RX_SR_COPY_TO_CPU_BIT4 = 198, /* SR custom reason code bit 4 */
_SHR_RX_SR_COPY_TO_CPU_BIT5 = 199, /* SR custom reason code bit 5 */
_SHR_RX_REASON_COUNT = 200 /* MUST BE LAST */
} _shr_rx_reason_t;
#define _SHR_RX_REASON_NAMES_INITIALIZER { \
......@@ -367,7 +412,49 @@ typedef enum _shr_rx_reason_e {
"Reserved0", \
"OAMMplsLmDM", \
"SAT", \
"SampleSourceFlex" \
"SampleSourceFlex", \
"FlexSflow", \
"VxltMiss", \
"TunnelDecapEcnError", \
"TunnelObjectValidationFail", \
"L3Cpu", \
"TunnelAdaptLookupMiss", \
"PacketFlowSelectMiss", \
"ProtectionDataDrop", \
"PacketFlowSelect", \
"OtherLookupMiss", \
"InvalidTpid", \
"MplsControlPacket", \
"TunnelTtlError", \
"L2HeaderError", \
"OtherLookupHit", \
"L2SrcLookupMiss", \
"L2SrcLookupHit", \
"L2DstLookupMiss", \
"L2DstLookupHit", \
"L3SrcRouteLookupMiss", \
"L3SrcHostLookupMiss", \
"L3SrcRouteLookupHit", \
"L3SrcHostLookupHit", \
"L3DstRouteLookupMiss", \
"L3DstHostLookupMiss", \
"L3DstRouteLookupHit", \
"L3DstHostLookupHit", \
"MplsLookup1Miss", \
"MplsLookup2Miss", \
"L3TunnelLookupMiss", \
"VlanTranslate1Lookup1Miss",\
"VlanTranslate1Lookup2Miss",\
"VlanTranslate2Lookup1Miss",\
"VlanTranslate2Lookup2Miss",\
"L2StuFail", \
"SrCounterExceeded", \
"SrCopyToCpuBit0", \
"SrCopyToCpuBit1", \
"SrCopyToCpuBit2", \
"SrCopyToCpuBit3", \
"SrCopyToCpuBit4", \
"SrCopyToCpuBit5", \
}
/*
......
......@@ -28,5 +28,18 @@
#define _SHR_SWITCH_STABLE_DEVICE_NEXT_HOP 1 /* Use next hop table */
#define _SHR_SWITCH_STABLE_DEVICE_EXT_MEM 2 /* Use external TCAM/SRAM */
#define _SHR_SWITCH_STABLE_APPLICATION 3 /* Use application storage */
#define _SHR_SWITCH_STABLE_SHARED_MEM 4 /* Use Linux shmem for internal proccess NV storage */
/*
* structure:
* _shr_temperature_monitor_t
* Purpose:
* entry type for retrieving temperature monitor value
*
*/
typedef struct _shr_switch_temperature_monitor_s {
int curr;
int peak;
} _shr_switch_temperature_monitor_t;
#endif /* !_SHR_SWITCH_H */
......@@ -21,33 +21,44 @@
#ifndef _SHR_TYPES_H_
#define _SHR_TYPES_H_
#include <sal/types.h>
typedef int8 _shr_dma_chan_t;
typedef enum {
_SHR_COLOR_GREEN = 0,
_SHR_COLOR_YELLOW = 1,
_SHR_COLOR_RED = 2,
_SHR_COLOR_BLACK = 3,
_SHR_COLOR_PRESERVE = 4,
_SHR_COLOR_COUNT = 5
typedef int _shr_module_t;
typedef int _shr_if_t;
typedef uint16 _shr_vlan_t;
#define _SHR_PORT_INVALID (-1)
typedef enum {
_SHR_COLOR_GREEN = 0,
_SHR_COLOR_YELLOW = 1,
_SHR_COLOR_RED = 2,
_SHR_COLOR_BLACK = 3,
_SHR_COLOR_PRESERVE = 4,
_SHR_COLOR_COUNT = 5
} _shr_color_t;
typedef enum {
_SHR_FORWARDING_TYPE_L2 = 0, /* L2 switching forwarding. */
_SHR_FORWARDING_TYPE_IP4UCAST = 1, /* IPv4 Unicast Routing forwarding. */
_SHR_FORWARDING_TYPE_IP4MCAST = 2, /* IPv4 Multicast Routing forwarding. */
_SHR_FORWARDING_TYPE_IP6UCAST = 3, /* IPv6 Unicast Routing forwarding. */
_SHR_FORWARDING_TYPE_IP6MCAST = 4, /* IPv6 Multicast Routing forwarding. */
_SHR_FORWARDING_TYPE_MPLS = 5, /* MPLS Switching forwarding. */
_SHR_FORWARDING_TYPE_TRILL = 6, /* Trill forwarding. */
_SHR_FORWARDING_TYPE_RXREASON = 7, /* Forwarding according to a RxReason. */
_SHR_FORWARDING_TYPE_TRAFFIC_MANAGMENT = 8, /* Traffic Management forwarding, when
an external Packet Processor sets the
forwarding decision. */
_SHR_FORWARDING_TYPE_SNOOP = 9, /* Snooped packet. */
_SHR_FORWARDING_TYPE_FCoE = 10, /* Fiber Channel over Ethernet
forwarding. */
_SHR_FORWARDING_TYPE_COUNT = 11 /* Always Last. Not a usable value. */
_SHR_FORWARDING_TYPE_L2 = 0, /* L2 switching forwarding. */
_SHR_FORWARDING_TYPE_IP4UCAST = 1, /* IPv4 Unicast Routing forwarding. */
_SHR_FORWARDING_TYPE_IP4MCAST = 2, /* IPv4 Multicast Routing forwarding. */
_SHR_FORWARDING_TYPE_IP6UCAST = 3, /* IPv6 Unicast Routing forwarding. */
_SHR_FORWARDING_TYPE_IP6MCAST = 4, /* IPv6 Multicast Routing forwarding. */
_SHR_FORWARDING_TYPE_MPLS = 5, /* MPLS Switching forwarding. */
_SHR_FORWARDING_TYPE_TRILL = 6, /* Trill forwarding. */
_SHR_FORWARDING_TYPE_RXREASON = 7, /* Forwarding according to a RxReason. */
_SHR_FORWARDING_TYPE_TRAFFIC_MANAGMENT = 8, /* Traffic Management forwarding, when
an external Packet Processor sets the
forwarding decision. */
_SHR_FORWARDING_TYPE_SNOOP = 9, /* Snooped packet. */
_SHR_FORWARDING_TYPE_FCoE = 10, /* Fiber Channel over Ethernet
forwarding. */
_SHR_FORWARDING_TYPE_COUNT = 11 /* Always Last. Not a usable value. */
} _shr_forwarding_type_t;
#endif /* _SHR_TYPES_H_ */
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: ibde.h,v 1.27 2012/11/02 23:10:59 bpeela Exp $
* $Id: ibde.h,v 1.27 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
......@@ -81,6 +81,7 @@ typedef struct ibde_s {
#define BDE_CPU_DEV_TYPE SAL_CPU_DEV_TYPE /* CPU device */
#define BDE_BYTE_SWAP 0x01000000 /* SW byte swap */
#define BDE_NO_IPROC 0x02000000 /* Device uses two BARs, but is not iProc */
#define BDE_256K_REG_SPACE 0x20000000 /* Map 256K (v 64K) */
#define BDE_128K_REG_SPACE 0x40000000 /* Map 128K (v 64K) */
......@@ -119,7 +120,7 @@ typedef struct ibde_s {
int (*interrupt_disconnect)(int d);
sal_paddr_t (*l2p)(int d, void *laddr);
uint32 *(*p2l)(int d, sal_paddr_t paddr);
void* (*p2l)(int d, sal_paddr_t paddr);
/*
* SPI Access via SMP
......@@ -142,6 +143,11 @@ typedef struct ibde_s {
void (*shmem_write)(int dev, uint32 addr, uint8 *buf, uint32 len);
sal_vaddr_t (*shmem_map)(int dev, uint32 addr, uint32 size);
/*
* cmic
*/
int (*get_cmic_ver)(int d, uint32 *ver);
} ibde_t;
......
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: kcom.h,v 1.9 2012/10/24 09:55:42 mlarsen Exp $
* $Id: kcom.h,v 1.9 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*
......@@ -57,6 +57,8 @@
#define KCOM_M_FILTER_LIST 23 /* Get list of Rx filter IDs */
#define KCOM_M_FILTER_GET 24 /* Get Rx filter info */
#define KCOM_M_DMA_INFO 31 /* Tx/Rx DMA info */
#define KCOM_M_DBGPKT_SET 41 /* Enbale debug packet function */
#define KCOM_M_DBGPKT_GET 42 /* Get debug packet function info */
#define KCOM_VERSION 8 /* Protocol version */
......@@ -115,6 +117,8 @@ typedef struct kcom_msg_hdr_s {
#define KCOM_NETIF_F_ADD_TAG (1U << 0)
#define KCOM_NETIF_F_RCPU_ENCAP (1U << 1)
/* If a netif has this flag, the packet sent to the netif can't be stripped tag or added tag */
#define KCOM_NETIF_F_KEEP_RX_TAG (1U << 2)
#define KCOM_NETIF_NAME_MAX 16
......@@ -127,6 +131,8 @@ typedef struct kcom_netif_s {
uint16 vlan;
uint16 qnum;
uint8 macaddr[6];
uint8 ptch[2];
uint8 itmh[4];
char name[KCOM_NETIF_NAME_MAX];
} kcom_netif_t;
......@@ -271,6 +277,9 @@ typedef struct kcom_dma_info_s {
} data;
} kcom_dma_info_t;
/* Default channel configuration */
#define KCOM_DMA_TX_CHAN 0
#define KCOM_DMA_RX_CHAN 1
#define KCOM_ETH_HW_T_RESET 1
......@@ -373,6 +382,22 @@ typedef struct kcom_msg_detach_s {
uint32 flags;
} kcom_msg_detach_t;
/*
* Enable/Disable debugging packet function.
*/
typedef struct kcom_msg_dbg_pkt_set_s {
kcom_msg_hdr_t hdr;
int enable;
} kcom_msg_dbg_pkt_set_t;
/*
* Get debugging packet function info.
*/
typedef struct kcom_msg_dbg_pkt_get_s {
kcom_msg_hdr_t hdr;
int value;
} kcom_msg_dbg_pkt_get_t;
/*
* Create new system network interface. The network interface will
* be associated with the specified switch unit number.
......@@ -431,7 +456,7 @@ typedef struct kcom_msg_filter_destroy_s {
* Get list of currently defined packet filters.
*/
#ifndef KCOM_FILTER_MAX
/* OPENNSL_FIXUP - Increased the filters to 1024 from 128 */
/* OPENNSL_FIXUP - Increased the filters to 1024 from 128 */
#define KCOM_FILTER_MAX 1024
#endif
......@@ -479,6 +504,8 @@ typedef union kcom_msg_s {
kcom_msg_filter_list_t filter_list;
kcom_msg_filter_get_t filter_get;
kcom_msg_dma_info_t dma_info;
kcom_msg_dbg_pkt_set_t dbg_pkt_set;
kcom_msg_dbg_pkt_get_t dbg_pkt_get;
} kcom_msg_t;
......
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: sync.h,v 1.1 2005/06/25 22:26:59 mlarsen Exp $
* $Id: sync.h,v 1.1 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
......
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: thread.h,v 1.1 2005/06/25 22:26:59 mlarsen Exp $
* $Id: thread.h,v 1.1 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
......
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: types.h,v 1.3 2013/04/06 06:19:14 mlarsen Exp $
* $Id: types.h,v 1.3 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*
......
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: sdk_config.h,v 1.5 2012/03/02 15:13:56 yaronm Exp $
* $Id: sdk_config.h,v 1.5 Broadcom SDK $
* $Copyright: (c) 2006 Broadcom Corp.
* All Rights Reserved.$
*
......
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: cmic.h,v 1.1 2008/10/16 09:41:21 mlarsen Exp $
* $Id: cmic.h,v 1.1 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*
......
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Make.config,v 1.3 2011/09/08 06:37:31 mlarsen Exp $
# $Id: Make.config,v 1.3 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
......
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Make.depend,v 1.14 2011/04/12 15:35:33 yshtil Exp $
# $Id: Make.depend,v 1.14 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
......
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Make.kernlib,v 1.7 2011/08/21 07:18:42 bhanup Exp $
# $Id: Make.kernlib,v 1.7 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
......@@ -46,7 +46,9 @@ endif
$Q$(RM) $@
$Q$(AR) ${ARFLAGS} $@ $(sort ${BOBJS})
ifeq ($(LINUX_MAKE_SHARED_LIB),1)
ifeq ($(targetbase),unix)
$(CC) -shared -Wl,-soname,${targetlibsoname} -o ${targetlibso} ${BOBJS} -lc
endif
endif # LINUX_MAKE_SHARED_LIB #
endif # !Borland
......@@ -62,6 +64,7 @@ ifdef QUIET
endif
$Q$(RM) ${BOBJS}
$Q$(RM) ${targetlib}
$Q$(RM) ${targetlibso}
distclean:: clean
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Make.lib,v 1.14 2010/11/18 00:27:38 yshtil Exp $
# $Id: Make.lib,v 1.14 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
......@@ -61,7 +61,7 @@ ifdef QUIET
endif
$Q$(RM) $@
ifeq ($(LINUX_MAKE_SHARED_LIB),1)
$(CC) -shared -Wl,-soname,${lib}.${LIBSUFFIX} -o ${targetlib} ${BOBJS} -lc
$(CC) -shared -Wl,-soname,${lib}.${LIBSUFFIX}${EXTRA_LIB_LDFLAGS} -o ${targetlib} ${BOBJS} -lc
else
${Q}cd $(dir $(word 1,${BOBJS}));$(AR) ${ARFLAGS} $@ $(sort $(notdir ${BOBJS}))
endif
......
......@@ -15,7 +15,7 @@
# of the software.
#
#
# $Id: Make.linux,v 1.18 2012/03/02 15:09:07 yaronm Exp $
# $Id: Make.linux,v 1.18 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
......@@ -93,6 +93,6 @@ clean_d: clean
distclean:
$(MAKE) $(CMD) $@
.PHONY: build clean distclean clean_d DELIVER variable mod bcm user
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Make.subdirs,v 1.8 2010/06/22 15:23:57 alai Exp $
# $Id: Make.subdirs,v 1.8 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
......
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Make.tools,v 1.2 2011/09/06 21:30:39 yshtil Exp $
# $Id: Make.tools,v 1.2 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
......
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
#
# As a special exception, the copyright holders of this software give
# you permission to link this software with independent modules, and to
# copy and distribute the resulting executable under terms of your
# choice, provided that you also meet, for each linked independent
# module, the terms and conditions of the license of that module. An
# independent module is a module which is not derived from this
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-gto-4_4,v 1.42 Broadcom SDK $
# $Copyright: (c) 2015 Broadcom Corp.
# All Rights Reserved.$
# User must select one platform from below.
ifeq (,$(BUILD_PLATFORM))
BUILD_PLATFORM=POWERPC_LINUX
endif
# TOOLCHAIN_BASE_DIR Toolchain base directory for GTO devices
# TARGET_ARCHITECTURE Compiler for target architecture
# KERNDIR Kernel directory for iPROC-CMICd devices
TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/gto
TARGET_ARCHITECTURE := powerpc-broadcom-linux-gnuspe
KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/current
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE := $(TARGET_ARCHITECTURE)-
endif
# GTO toolchain
TOOLCHAIN_BIN_DIR := $(TOOLCHAIN_BASE_DIR)/toolchain/host/usr/bin
override PATH := $(TOOLCHAIN_BIN_DIR)/../$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH)
export TOOLCHAIN_BIN_DIR
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
ENDIAN = BE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"GTO_MPC8548\"
CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=32
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
ARCH = powerpc
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
# From linux/arch/ppc/Makefile
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
KFLAG_INCLD = $(TOOLCHAIN_BIN_DIR)/../lib/gcc/$(TARGET_ARCHITECTURE)/4.6.4/include
ifdef BROADCOM_SVK
ifdef BCM_BME3200_B0
PLX_PCI2LBUS=1
endif
ifdef BCM_BM9600_B0
PLX_PCI2LBUS=1
endif
ifeq ($PLX_PCI2LBUS, 1)
CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE
endif
endif
ifdef DPP_CHIPS
CFLAGS += -DDUNE_BCM -D__DUNE_GTO_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__ -D__DUNE_LINUX_BCM_CPU_PCP_DMA__
CFGFLAGS += -DSOC_CM_FUNCTION
endif
ifdef DFE_CHIPS
CFLAGS += -DDUNE_BCM -D__DUNE_GTO_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__
CFGFLAGS += -DSOC_CM_FUNCTION
endif
ifdef SHADOW_PLX
CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -DSHADOW_SVK
endif
ifeq (,$(KFLAGS))
KFLAGS := -D__KERNEL__ -m32 -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/generated/uapi/linux/version.h -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(KERNDIR)/arch/powerpc -I$(KERNDIR)/arch/powerpc/include -I$(KERNDIR)/include/asm-powerpc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -msoft-float -pipe -ffixed-r2 -mmultiple -mno-altivec -funit-at-a-time -Wa,-me500 -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign
endif
ifneq (,$(findstring TCL,$(FEATURE_LIST)))
#LINK_STATIC = 0
#export LINK_STATIC
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-4_4
endif
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-gto-2_6,v 1.42 2013/03/23 00:35:18 gururaj Exp $
# $Id: Makefile.linux-gto-2_6,v 1.42 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
......@@ -237,15 +237,19 @@ endif
endif
ifdef DPP_CHIPS
CFLAGS += -DDUNE_BCM -D__DUNE_GTO_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__ -D__DUNE_LINUX_BCM_CPU_PCP_DMA__
CFLAGS += -DDUNE_BCM -D__DUNE_LINUX_BCM_CPU_PCP_DMA__
CFGFLAGS += -DSOC_CM_FUNCTION
endif
ifdef DFE_CHIPS
CFLAGS += -DDUNE_BCM -D__DUNE_GTO_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__
CFLAGS += -DDUNE_BCM
CFGFLAGS += -DSOC_CM_FUNCTION
endif
ifdef SAND_CHIPS
CFLAGS += -D__DUNE_GTO_BCM_CPU__ -D__DUNE_LINUX_BCM_CPU_PCIE__
endif
ifdef SHADOW_PLX
CFLAGS += -DBCM_PLX9656_LOCAL_BUS -DBDE_LINUX_NON_INTERRUPTIBLE -DSHADOW_SVK
endif
......
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
#
# As a special exception, the copyright holders of this software give
# you permission to link this software with independent modules, and to
# copy and distribute the resulting executable under terms of your
# choice, provided that you also meet, for each linked independent
# module, the terms and conditions of the license of that module. An
# independent module is a module which is not derived from this
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-iproc Exp $
# $Copyright: (c) 2007 Broadcom Corp.
# All Rights Reserved.$
# Makefile for iproc-CMICd
# User must select one platform from below.By default ARM_LINUX is selected. .
ifeq (,$(BUILD_PLATFORM))
BUILD_PLATFORM=ARM_LINUX
endif
# TOOLCHAIN_BASE_DIR Toolchain base directory for iPROC-CMICd devices
# TARGET_ARCHITECTURE Compiler for target architecture
# KERNDIR Kernel directory for iPROC-CMICd devices
ifeq (BE,$(ENDIAN_MODE))
TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/iproc-be/XLDK
TARGET_ARCHITECTURE:=armeb-broadcom-linux-uclibcgnueabi
KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/linux
else
TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/iproc/XLDK
TARGET_ARCHITECTURE:= arm-broadcom-linux-uclibcgnueabi
KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/linux
endif
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE:= $(TARGET_ARCHITECTURE)-
endif
# arm9tools
TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/bin
override PATH:=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH)
LD_LIBRARY_PATH=$(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/lib
export TOOLCHAIN_BIN_DIR LD_LIBRARY_PATH
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
ifeq (BE,$(ENDIAN_MODE))
CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
ENDIAN = BE_HOST=1
else
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
ENDIAN = LE_HOST=1
endif
CFGFLAGS += -D$(ENDIAN) -DIPROC_CMICD
CFGFLAGS += -DBCM_PLATFORM_STRING=\"IPROC_CMICD\"
ARCH = arm
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
KFLAG_INCLD ?= $(TOOLCHAIN_BASE_DIR)/buildroot/host/usr/lib/gcc/$(TARGET_ARCHITECTURE)/4.9.3/include
ifeq (,$(KFLAGS))
KFLAGS := -D__LINUX_ARM_ARCH__=7 -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(KERNDIR)/arch/arm/include -I$(KERNDIR)/arch/arm/include/generated -I$(KERNDIR)/arch/arm/mach-iproc/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -marm -mabi=aapcs-linux -fno-pic -pipe -msoft-float -ffreestanding -march=armv7-a -mfpu=vfp -mfloat-abi=softfp -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
KFLAGS += -I$(LINUX_INCLUDE)/uapi -I$(LINUX_INCLUDE)/generated/uapi -I$(KERNDIR)/arch/arm/include/uapi -I$(KERNDIR)/arch/arm/include/generated/uapi
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-3_6
endif
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
#
# As a special exception, the copyright holders of this software give
# you permission to link this software with independent modules, and to
# copy and distribute the resulting executable under terms of your
# choice, provided that you also meet, for each linked independent
# module, the terms and conditions of the license of that module. An
# independent module is a module which is not derived from this
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-iproc-3_6,v 1.1 Broadcom SDK $
# $Copyright: (c) 2007 Broadcom Corp.
# All Rights Reserved.$
# Makefile for iproc-CMICd
# User must select one platform from below.By default ARM_LINUX is selected. .
ifeq (,$(BUILD_PLATFORM))
BUILD_PLATFORM=ARM_LINUX
endif
# TOOLCHAIN_BASE_DIR Toolchain base directory for iPROC-CMICd devices
# TARGET_ARCHITECTURE Compiler for target architecture
# KERNDIR Kernel directory for iPROC-CMICd devices
ifeq (BE,$(ENDIAN_MODE))
TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk37-be/buildroot-2013.11-gcc48-opt-broadcom
TARGET_ARCHITECTURE:=armeb-buildroot-linux-gnueabi
KERNDIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk37-be/XLDK/kernel/linux
else
TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/linux/iproc_ldks/xldk37/XLDK
TARGET_ARCHITECTURE:= arm-broadcom-linux-uclibcgnueabi
KERNDIR ?= $(TOOLCHAIN_BASE_DIR)/kernel/linux
endif
ifeq (,$(CROSS_COMPILE))
CROSS_COMPILE:= $(TARGET_ARCHITECTURE)-
endif
# arm9tools
ifeq (BE,$(ENDIAN_MODE))
TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_BASE_DIR)/host/usr/bin
override PATH:=$(TOOLCHAIN_BASE_DIR)/host/usr/$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH)
LD_LIBRARY_PATH=$(TOOLCHAIN_BASE_DIR)/host/usr/lib
else
TOOLCHAIN_BIN_DIR=$(TOOLCHAIN_BASE_DIR)/buildroot/usr/bin
override PATH:=$(TOOLCHAIN_BASE_DIR)/buildroot/usr/$(TARGET_ARCHITECTURE)/bin:$(TOOLCHAIN_BIN_DIR):$(PATH)
LD_LIBRARY_PATH=$(TOOLCHAIN_BASE_DIR)/buildroot/usr/lib
endif
export TOOLCHAIN_BIN_DIR LD_LIBRARY_PATH
# Default Linux include directory
ifeq (,$(LINUX_INCLUDE))
LINUX_INCLUDE := $(KERNDIR)/include
endif
ifeq (BE,$(ENDIAN_MODE))
CFGFLAGS += -DSYS_BE_PIO=1 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=1
ENDIAN = BE_HOST=1
else
CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
ENDIAN = LE_HOST=1
endif
CFGFLAGS += -D$(ENDIAN) -DIPROC_CMICD
CFGFLAGS += -DBCM_PLATFORM_STRING=\"IPROC_CMICD\"
ARCH = arm
KBUILD_VERBOSE = 1
export ARCH KBUILD_VERBOSE
comma = ,
basetarget = $(basename $(notdir $@))
modname = $(basetarget)
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
ifeq (BE,$(ENDIAN_MODE))
KFLAG_INCLD ?= $(TOOLCHAIN_BASE_DIR)/host/usr/lib/gcc/$(TARGET_ARCHITECTURE)/4.8.2/include
else
KFLAG_INCLD ?= $(TOOLCHAIN_BASE_DIR)/buildroot/usr/lib/gcc/$(TARGET_ARCHITECTURE)/4.7.2/include
endif
ifeq (,$(KFLAGS))
KFLAGS := -D__LINUX_ARM_ARCH__=7 -D__KERNEL__ -nostdinc -isystem $(KFLAG_INCLD) -I$(LINUX_INCLUDE) -include $(LINUX_INCLUDE)/generated/autoconf.h -I$(KERNDIR)/arch/arm/include -I$(KERNDIR)/arch/arm/include/generated -I$(KERNDIR)/arch/arm/mach-northstar/include -I$(KERNDIR)/arch/arm/plat-iproc/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -marm -mabi=aapcs-linux -fno-pic -pipe -msoft-float -ffreestanding -march=armv7-a -mfpu=vfp -mfloat-abi=softfp -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -mlong-calls
KFLAGS += -I$(LINUX_INCLUDE)/uapi -I$(LINUX_INCLUDE)/generated/uapi -I$(KERNDIR)/arch/arm/include/uapi -I$(KERNDIR)/arch/arm/include/generated/uapi
endif
ifneq ($(targetplat),user)
include ${SDK}/make/Makefile.linux-kernel-3_6
endif
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-kernel,v 1.27 2012/06/25 20:23:24 assafz Exp $
# $Id: Makefile.linux-kernel,v 1.27 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
......
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-kernel-2_6,v 1.40 2012/10/22 01:56:23 alai Exp $
# $Id: Makefile.linux-kernel-2_6,v 1.40 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
......
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
#
# As a special exception, the copyright holders of this software give
# you permission to link this software with independent modules, and to
# copy and distribute the resulting executable under terms of your
# choice, provided that you also meet, for each linked independent
# module, the terms and conditions of the license of that module. An
# independent module is a module which is not derived from this
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-kernel-3_6,v 1.2 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
# Configuration Flags
# Filter out features that cannot or should not be supported in kernel mode
_FEATURE_EXCLUDE_LIST += EDITLINE TCL OOB_RCPU CINT APIMODE DUNE_UI
FEATURE_EXCLUDE_LIST = $(sort $(_FEATURE_EXCLUDE_LIST))
# Tools
# Conditionally Replaces DEFAULT var
ifeq ($(origin CC),default)
CC = $(LSRUN) $(CROSS_COMPILE)gcc
endif
ifeq ($(origin CXX),default)
CXX = $(CROSS_COMPILE)g++
endif
ifeq ($(origin LD),default)
LD = $(CROSS_COMPILE)ld
endif
ifeq ($(origin AR),default)
AR = $(CROSS_COMPILE)ar
endif
ifeq ($(origin AS),default)
AS = $(CROSS_COMPILE)as
endif
ifeq ($(origin ARFLAGS),default)
ARFLAGS = -rc
endif
STRIP = $(CROSS_COMPILE)strip
RANLIB = $(CROSS_COMPILE)ranlib
OBJCOPY = $(CROSS_COMPILE)objcopy
NM = $(CROSS_COMPILE)nm
# Handle differences between gcc 2.x and gcc 3.x
gcc-tune-flag = $(shell if ${CC} -dumpspecs | grep mcpu >/dev/null; then echo cpu; else echo tune; fi)
# Configuration Variables
# OSType Defines: This defines the type of RTOS or microkernel which you
# are compiling the SAL (and its associated driver) for. New platforms
# can be created by porting the routines (system.c) to your platform and
# adding the define in this Makefile.
OSTYPE = LINUX
#
# ORIGIN is used to Optionally select different CFLAGS. It is used to import
# source from other vendors. If SOURCE=Broadcom, then the BCM_ flags are added
# to those passed to the compiler. If SOURCE != Broadcom, BCM_ flags are NOT
# added.
#
# Default specifies Broadcom
#
ifndef ORIGIN
ORIGIN = Broadcom
endif
#
# STD_{C|CPP|CXX}FLAGS - Standard flags used by ALL compilations
# BCM_{C|CPP|CXX}FLAGS - Flags used for Broadcom source files
# OPT_{C|CPP|CXX}FLAGS - Defined in local make files BEFORE inclusion of
# this Makefile, to define local "Extra" flags.
#
ifdef IPROC_BUILD
CFGFLAGS += -I$(SDK)/systems/linux/kernel/modules/include \
-I$(SDK)/systems/bde/linux/include \
-I$(LINUX_INCLUDE) \
-I$(KERNDIR)/arch/$(ARCH)
else
CFGFLAGS += -I$(SDK)/systems/linux/kernel/modules/include \
-I$(SDK)/systems/bde/linux/include \
-I$(LINUX_INCLUDE) \
-I$(LINUX_INCLUDE)/asm/gcc \
-I$(LINUX_INCLUDE)/asm/mach-generic \
-I$(KERNDIR)/arch/$(ARCH)
endif
CFGFLAGS += -DNO_FILEIO -DNO_CTRL_C -DNO_MEMTUNE
CFGFLAGS += -D$(OSTYPE)
# No user sal for the linux kernel
# NO_SAL_APPL=1
STD_CFLAGS = $(KFLAGS) $(CFGFLAGS)
STD_CPPFLAGS = ${STD_CFLAGS}
STD_CXXFLAGS = ${STD_CFLAGS}
ifndef BCM_CFLAGS
BCM_CFLAGS = -Wall -Werror
endif
BCM_CPPFLAGS = ${BCM_CFLAGS}
BCM_CXXFLAGS = ${BCM_CFLAGS}
ifeq (${ORIGIN}, Broadcom)
CFLAGS += ${STD_CFLAGS} ${BCM_CFLAGS} ${OPT_CFLAGS}
CPPFLAGS += ${STD_CPPFLAGS} ${BCM_CPPFLAGS} ${OPT_CPPFLAGS}
CXXFLAGS += ${STD_CXXFLAGS} ${BCM_CXXFLAGS} ${OPT_CXXFLAGS}
else
CFLAGS += ${STD_CFLAGS} ${OPT_CFLAGS}
CPPFLAGS += ${STD_CPPFLAGS} ${OPT_CPPFLAGS}
CXXFLAGS += ${STD_CXXFLAGS} ${OPT_CXXFLAGS}
endif
#
# Ignore pedantic flag for kernel modules
#
ifdef DEBUG_PEDANTIC
DEBUG_PEDANTIC = FALSE
endif
#
# DEPEND is used as a command to generate the list of dependencies.
# The format of the output must be
# "file.o : file.c a/b/c.h d/e/f.h ...",
# if it is on multiple lines, each line must end in a backslash.
# The output MUST be on standard out.
#
DEPEND = ${CC} -M $(CFLAGS) $<
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
#
# As a special exception, the copyright holders of this software give
# you permission to link this software with independent modules, and to
# copy and distribute the resulting executable under terms of your
# choice, provided that you also meet, for each linked independent
# module, the terms and conditions of the license of that module. An
# independent module is a module which is not derived from this
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-kernel-2_6,v 1.40 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
# Configuration Flags
# Filter out features that cannot or should not be supported in kernel mode
_FEATURE_EXCLUDE_LIST += EDITLINE TCL OOB_RCPU CINT APIMODE DUNE_UI C_UNIT
FEATURE_EXCLUDE_LIST = $(sort $(_FEATURE_EXCLUDE_LIST))
# Tools
# Conditionally Replaces DEFAULT var
ifeq ($(origin CC),default)
CC = $(LSRUN) $(CROSS_COMPILE)gcc
endif
ifeq ($(origin CXX),default)
CXX = $(CROSS_COMPILE)g++
endif
ifeq ($(origin LD),default)
LD = $(CROSS_COMPILE)ld
endif
ifeq ($(origin AR),default)
AR = $(CROSS_COMPILE)ar
endif
ifeq ($(origin AS),default)
AS = $(CROSS_COMPILE)as
endif
ifeq ($(origin ARFLAGS),default)
ARFLAGS = -rc
endif
STRIP = $(CROSS_COMPILE)strip
RANLIB = $(CROSS_COMPILE)ranlib
OBJCOPY = $(CROSS_COMPILE)objcopy
NM = $(CROSS_COMPILE)nm
# Handle differences between gcc 2.x and gcc 3.x
gcc-tune-flag = $(shell if ${CC} -dumpspecs | grep mcpu >/dev/null; then echo cpu; else echo tune; fi)
# Configuration Variables
# OSType Defines: This defines the type of RTOS or microkernel which you
# are compiling the SAL (and its associated driver) for. New platforms
# can be created by porting the routines (system.c) to your platform and
# adding the define in this Makefile.
OSTYPE = LINUX
#
# ORIGIN is used to Optionally select different CFLAGS. It is used to import
# source from other vendors. If SOURCE=Broadcom, then the BCM_ flags are added
# to those passed to the compiler. If SOURCE != Broadcom, BCM_ flags are NOT
# added.
#
# Default specifies Broadcom
#
ifndef ORIGIN
ORIGIN = Broadcom
endif
#
# STD_{C|CPP|CXX}FLAGS - Standard flags used by ALL compilations
# BCM_{C|CPP|CXX}FLAGS - Flags used for Broadcom source files
# OPT_{C|CPP|CXX}FLAGS - Defined in local make files BEFORE inclusion of
# this Makefile, to define local "Extra" flags.
#
ifdef IPROC_BUILD
CFGFLAGS += -I$(SDK)/systems/linux/kernel/modules/include \
-I$(SDK)/systems/bde/linux/include \
-I$(LINUX_INCLUDE) \
-I$(LINUX_INCLUDE)/uapi \
-I$(LINUX_INCLUDE)/generated/uapi \
-I$(KERNDIR)/arch/$(ARCH) \
-I$(KERNDIR)/arch/$(ARCH)/include/uapi \
-I$(KERNDIR)/arch/$(ARCH)/include/generated \
-I$(KERNDIR)/arch/$(ARCH)/include/generated/uapi
else
CFGFLAGS += -I$(SDK)/systems/linux/kernel/modules/include \
-I$(SDK)/systems/bde/linux/include \
-I$(LINUX_INCLUDE) \
-I$(LINUX_INCLUDE)/asm/gcc \
-I$(LINUX_INCLUDE)/asm/mach-generic \
-I$(LINUX_INCLUDE)/uapi \
-I$(LINUX_INCLUDE)/generated/uapi \
-I$(KERNDIR)/arch/$(ARCH) \
-I$(KERNDIR)/arch/$(ARCH)/include/uapi \
-I$(KERNDIR)/arch/$(ARCH)/include/generated \
-I$(KERNDIR)/arch/$(ARCH)/include/generated/uapi
endif
CFGFLAGS += -DNO_FILEIO -DNO_CTRL_C -DNO_MEMTUNE
CFGFLAGS += -D$(OSTYPE)
# No user sal for the linux kernel
# NO_SAL_APPL=1
STD_CFLAGS = $(KFLAGS) $(CFGFLAGS)
STD_CPPFLAGS = ${STD_CFLAGS}
STD_CXXFLAGS = ${STD_CFLAGS}
ifndef BCM_CFLAGS
BCM_CFLAGS = -Wall -Werror
endif
BCM_CPPFLAGS = ${BCM_CFLAGS}
BCM_CXXFLAGS = ${BCM_CFLAGS}
ifeq (${ORIGIN}, Broadcom)
CFLAGS += ${STD_CFLAGS} ${BCM_CFLAGS} ${OPT_CFLAGS}
CPPFLAGS += ${STD_CPPFLAGS} ${BCM_CPPFLAGS} ${OPT_CPPFLAGS}
CXXFLAGS += ${STD_CXXFLAGS} ${BCM_CXXFLAGS} ${OPT_CXXFLAGS}
else
CFLAGS += ${STD_CFLAGS} ${OPT_CFLAGS}
CPPFLAGS += ${STD_CPPFLAGS} ${OPT_CPPFLAGS}
CXXFLAGS += ${STD_CXXFLAGS} ${OPT_CXXFLAGS}
endif
#
# Ignore pedantic flag for kernel modules
#
ifdef DEBUG_PEDANTIC
DEBUG_PEDANTIC = FALSE
endif
#
# DEPEND is used as a command to generate the list of dependencies.
# The format of the output must be
# "file.o : file.c a/b/c.h d/e/f.h ...",
# if it is on multiple lines, each line must end in a backslash.
# The output MUST be on standard out.
#
DEPEND = ${CC} -M $(CFLAGS) $<
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-kmodule-3_6,v 1.2 2013/01/10 01:00:49 bpeela Exp $
# $Id: Makefile.linux-kmodule-3_6,v 1.2 Broadcom SDK $
# $Copyright: (c) 2006 Broadcom Corp.
# All Rights Reserved.$
......@@ -55,6 +55,9 @@ A := ARCH=$(ARCH)
export ARCH
endif
# Provide an option in case kernel was built in separate directory
KERNBLDDIR ?= $(KERNDIR)
# Standard SDK include path for building source files that export
# kernel symbols.
......@@ -70,7 +73,7 @@ $(KMODULE):
rm -fr .tmp_versions
ln -s $(LIBDIR)/$(MODULE) $(PRE_COMPILED_OBJ)_shipped
echo "suppress warning" > .$(PRE_COMPILED_OBJ).cmd
$(MAKE) -C $(KERNDIR) CROSS_COMPILE=$(CROSS_COMPILE) M=$(PWD) modules
$(MAKE) -C $(KERNBLDDIR) CROSS_COMPILE=$(CROSS_COMPILE) M=$(PWD) modules
if [ ! -f Module.symvers ]; then echo "old kernel (pre-2.6.17)" > Module.symvers; fi
cp -f $(KMODULE) $(LIBDIR)
rm -f $(PRE_COMPILED_OBJ)_shipped
......
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-x86-common-2_6,v 1.13 2011/08/23 02:32:54 mlarsen Exp $
# $Id: Makefile.linux-x86-common-2_6,v 1.13 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
......@@ -22,7 +22,9 @@ CFGFLAGS += -DSYS_BE_PIO=0 -DSYS_BE_PACKET=0 -DSYS_BE_OTHER=0
ENDIAN = LE_HOST=1
CFGFLAGS += -D$(ENDIAN)
CFGFLAGS += -DBCM_PLATFORM_STRING=\"X86\"
ifeq (,$(findstring -DSAL_BDE_DMA_MEM_DEFAULT,$(CFGFLAGS)))
CFGFLAGS += -DSAL_BDE_DMA_MEM_DEFAULT=16
endif
# Extra variables.
EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
......
......@@ -14,7 +14,7 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-x86-generic-common-2_6,v 1.2 2011/08/23 01:35:32 mlarsen Exp $
# $Id: Makefile.linux-x86-generic-common-2_6,v 1.2 Broadcom SDK $
# $Copyright: (c) 2008 Broadcom Corp.
# All Rights Reserved.$
......
......@@ -14,26 +14,21 @@
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Makefile.linux-x86-smp_generic_64-2_6,v 1.5 2012/02/21 21:36:45 miyarn Exp $
# $Id: Makefile.linux-x86-smp_generic_64-2_6,v 1.5 Broadcom SDK $
# $Copyright: (c) 2008 Broadcom Corp.
# All Rights Reserved.$
CFGFLAGS += -DLONGS_ARE_64BITS
CFGFLAGS += -DPTRS_ARE_64BITS
CFGFLAGS += -DPHYS_ADDRS_ARE_64BITS
CFGFLAGS += -DSAL_SPL_LOCK_ON_IRQ
include ${SDK}/make/Makefile.linux-x86-generic-common-2_6
ifeq (,$(KFLAGS))
KFLAGS := -nostdinc -isystem $(SYSINC) -I$(KERNDIR)/include -I$(KERNDIR)/arch/x86/include -include $(AUTOCONF) -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-stack-protector -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign
KFLAGS := -nostdinc -isystem $(SYSINC) -I$(KERNDIR)/include -I$(KERNDIR)/arch/x86/include -include $(AUTOCONF) -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-stack-protector -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign
endif
KFLAGS += -I$(LINUX_INCLUDE)/uapi -I$(LINUX_INCLUDE)/generated/uapi -I$(KERNDIR)/arch/x86/include/generated -I$(KERNDIR)/arch/x86/include/uapi -I$(KERNDIR)/arch/x86/include/generated/uapi
ifeq ($(LINUX_MAKE_SHARED_LIB),1)
KFLAGS += -fPIC -mcmodel=small
else
KFLAGS += -mcmodel=kernel
endif
include ${SDK}/make/Makefile.linux-x86-common-2_6
......@@ -16,7 +16,7 @@
*/
/***********************************************************************
*
* $Id: linux-bde.h,v 1.24 2013/01/30 16:52:27 gili Exp $
* $Id: linux-bde.h,v 1.24 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*
......@@ -77,6 +77,21 @@
#include <linux/version.h>
#ifdef __KERNEL__
#include <linux/types.h>
/* Key stone and Raptor has 2.6.21 but don't have definition */
#if defined(KEYSTONE) || defined(RAPTOR)
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21))
#ifdef PHYS_ADDRS_ARE_64BITS
typedef u64 phys_addr_t;
#else
typedef u32 phys_addr_t;
#endif
#endif
#endif
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
#define LINUX_BDE_DMA_DEVICE_SUPPORT
#endif
......@@ -148,21 +163,24 @@ extern int linux_bde_instance_attach(unsigned int dev_mask,unsigned int dma_size
*/
/*
* The user bde needs to get some physical addresses for
* the userland code to mmap.
* The user bde needs to get cpu physical address for
* the userland code to mmap.
* And the second address is bus address, it is either
* identical to cpu physical address or another address
* (IOVA) translated by IOMMU.
*/
extern int lkbde_get_dma_info(uint32 *pbase, uint32 *size);
extern uint32 lkbde_get_dev_phys(int d);
extern uint32 lkbde_get_dev_phys_hi(int d);
extern int lkbde_get_dma_info(phys_addr_t *cpu_pbase, phys_addr_t *dma_pbase, ssize_t *size);
extern uint32 lkbde_get_dev_phys(int d);
extern uint32 lkbde_get_dev_phys_hi(int d);
/*
* Virtual device address needed by kernel space
* Virtual device address needed by kernel space
* interrupt handler.
*/
extern void *lkbde_get_dev_virt(int d);
/*
* The user bde needs to get some physical addresses for
* The user bde needs to get some physical addresses for
* the userland code to mmap. The following functions
* supports multiple resources for a single device.
*/
......
/*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
*
* As a special exception, the copyright holders of this software give
* you permission to link this software with independent modules, and to
* copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module. An
* independent module is a module which is not derived from this
* software. The special exception does not apply to any modifications
* of the software.
*/
/***********************************************************************
*
* $Id: linux_dma.h,v 1.24 Broadcom SDK $
* $Copyright: (c) 2016 Broadcom Corp.
* All Rights Reserved.$
*
**********************************************************************/
#ifndef __LINUX_DMA_H__
#define __LINUX_DMA_H__
#include <sal/types.h>
#ifdef __KERNEL__
#ifdef SAL_BDE_XLP
#define KMALLOC(size, flags) __kmalloc(size, flags)
#else
#define KMALLOC(size, flags) kmalloc(size, flags)
#endif
#if defined(CONFIG_IDT_79EB334) || defined(CONFIG_BCM4702)
/* ioremap is broken in kernel */
#define IOREMAP(addr, size) ((void *)KSEG1ADDR(addr))
#else
#define IOREMAP(addr, size) ioremap_nocache(addr, size)
#endif
#if defined (__mips__)
#if defined(CONFIG_NONCOHERENT_IO) || defined(CONFIG_DMA_NONCOHERENT)
/* Use flush/invalidate for cached memory */
#define NONCOHERENT_DMA_MEMORY
/* Remap virtual DMA addresses to non-cached segment */
#define REMAP_DMA_NONCACHED
#endif /* CONFIG_NONCOHERENT_IO || CONFIG_DMA_NONCOHERENT */
#endif /* __mips__ */
#if defined(BCM958525) && (LINUX_VERSION_CODE <= KERNEL_VERSION(3,6,5))
#define REMAP_DMA_NONCACHED
#endif
#ifndef DMA_BIT_MASK
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
#endif
extern void _dma_init(int robo_switch);
extern int _dma_cleanup(void);
extern void _dma_pprint(void);
extern uint32_t *_salloc(int d, int size, const char *name);
extern void _sfree(int d, void *ptr);
extern int _sinval(int d, void *ptr, int length);
extern int _sflush(int d, void *ptr, int length);
extern sal_paddr_t _l2p(int d, void *vaddr);
extern void *_p2l(int d, sal_paddr_t paddr);
extern int _dma_pool_allocated(void);
extern int _dma_range_valid(unsigned long phys_addr, unsigned long size);
#endif /* __KERNEL__ */
#endif /* __LINUX_DMA_H__ */
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: mpool.h,v 1.2 2005/01/17 19:53:06 csm Exp $
* $Id: mpool.h,v 1.2 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
......
......@@ -15,7 +15,7 @@
# of the software.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.18 2013/01/10 01:00:43 bpeela Exp $
# $Id: Makefile,v 1.18 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
......@@ -55,7 +55,7 @@ else
LSRCS += etc_robo_spi.c aiutils.c
else
ifeq ($(platformbase), iproc)
LSRCS += robo_srab.c aiutils.c
LSRCS += robo_srab.c robo_spi.c aiutils.c
endif
endif
endif # platformbase
......
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: mpool.c,v 1.18 2012/03/02 15:53:32 yaronm Exp $
* $Id: mpool.c,v 1.18 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
......
......@@ -15,7 +15,7 @@
# of the software.
#
# -*- Makefile -*-
# $Id: Makefile,v 1.1 2008/10/16 09:41:22 mlarsen Exp $
# $Id: Makefile,v 1.1 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
......
......@@ -15,7 +15,7 @@
* of the software.
*/
/*
* $Id: linux-user-bde.h,v 1.23 2013/02/25 17:46:08 mason Exp $
* $Id: linux-user-bde.h,v 1.23 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
......
......@@ -38,4 +38,10 @@ shbde_pci_is_iproc(shbde_hal_t *shbde, void *pci_dev, int *cmic_bar);
extern int
shbde_pci_max_payload_set(shbde_hal_t *shbde, void *pci_dev, int maxpayload);
extern int
shbde_pci_iproc_version_get(shbde_hal_t *shbde, void *pci_dev,
unsigned int *iproc_ver,
unsigned int *cmic_ver,
unsigned int *cmic_rev);
#endif /* __SHBDE_PCI_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment