mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +08:00
S32K148EVB netdev lateinit to support Enet & CAN at the same time
This commit is contained in:
committed by
patacongo
parent
eca1011b1e
commit
4a40a7c3d7
@@ -55,7 +55,7 @@
|
|||||||
#define EMAC_INTF 0
|
#define EMAC_INTF 0
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Public Functions
|
* Public Function Prototypes
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
@@ -69,6 +69,8 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(CONFIG_NETDEV_LATEINIT)
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Function: arm_netinitialize
|
* Function: arm_netinitialize
|
||||||
*
|
*
|
||||||
@@ -91,6 +93,29 @@ extern "C"
|
|||||||
|
|
||||||
void arm_netinitialize(void);
|
void arm_netinitialize(void);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/************************************************************************************
|
||||||
|
* Function: s32k1xx_netinitialize
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Initialize the Ethernet controller and driver
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* intf - In the case where there are multiple EMACs, this value
|
||||||
|
* identifies which EMAC is to be initialized.
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* OK on success; Negated errno on failure.
|
||||||
|
*
|
||||||
|
* Assumptions:
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
||||||
|
|
||||||
|
int s32k1xx_netinitialize(int intf);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Function: s32k1xx_phy_boardinitialize
|
* Function: s32k1xx_phy_boardinitialize
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -69,6 +69,10 @@
|
|||||||
#include "s32k1xx_progmem.h"
|
#include "s32k1xx_progmem.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_S32K1XX_EEEPROM
|
||||||
|
#include "s32k1xx_eeeprom.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
@@ -55,6 +55,10 @@
|
|||||||
# include "s32k1xx_eeeprom.h"
|
# include "s32k1xx_eeeprom.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_S32K1XX_FLEXCAN
|
||||||
|
# include "s32k1xx_flexcan.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "s32k148evb.h"
|
#include "s32k148evb.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -113,6 +117,26 @@ int s32k1xx_bringup(void)
|
|||||||
/* Register EEEPROM block device */
|
/* Register EEEPROM block device */
|
||||||
|
|
||||||
s32k1xx_eeeprom_register(0, 4096);
|
s32k1xx_eeeprom_register(0, 4096);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_NETDEV_LATEINIT
|
||||||
|
|
||||||
|
# ifdef CONFIG_S32K1XX_ENET
|
||||||
|
s32k1xx_netinitialize(0);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef CONFIG_S32K1XX_FLEXCAN0
|
||||||
|
s32k1xx_caninitialize(0);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef CONFIG_S32K1XX_FLEXCAN1
|
||||||
|
s32k1xx_caninitialize(1);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef CONFIG_S32K1XX_FLEXCAN2
|
||||||
|
s32k1xx_caninitialize(2);
|
||||||
|
# endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user