diff options
author | Tom Rini <trini@konsulko.com> | 2015-08-04 12:21:45 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-08-04 12:21:45 -0400 |
commit | e22b1a54942d9003b10564325a34e3cf767556ce (patch) | |
tree | f244c37d0c1089b7e1858829e275be47f6f48ede /include | |
parent | 8889e984154f749047dc9ed3b4cd8b734dde66f2 (diff) | |
parent | e16b604ecf5701cc0ab4437bccfd65468035740b (diff) | |
download | u-boot-e22b1a54942d9003b10564325a34e3cf767556ce.tar.gz |
Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq
Diffstat (limited to 'include')
-rw-r--r-- | include/configs/ls1021aqds.h | 1 | ||||
-rw-r--r-- | include/configs/ls1021atwr.h | 13 | ||||
-rw-r--r-- | include/configs/ls2085aqds.h | 13 | ||||
-rw-r--r-- | include/configs/ls2085ardb.h | 13 | ||||
-rw-r--r-- | include/fsl-mc/fsl_dpbp.h | 49 | ||||
-rw-r--r-- | include/fsl-mc/fsl_dpio.h | 30 | ||||
-rw-r--r-- | include/fsl-mc/fsl_dpmng.h | 7 | ||||
-rw-r--r-- | include/fsl-mc/fsl_dpni.h | 115 | ||||
-rw-r--r-- | include/fsl-mc/fsl_dprc.h | 154 | ||||
-rw-r--r-- | include/fsl-mc/fsl_mc_cmd.h | 47 | ||||
-rw-r--r-- | include/fsl_ddr.h | 2 | ||||
-rw-r--r-- | include/fsl_sec.h | 13 | ||||
-rw-r--r-- | include/pci.h | 41 | ||||
-rw-r--r-- | include/tsec.h | 4 |
14 files changed, 401 insertions, 101 deletions
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h index 13f933876a..0871a71091 100644 --- a/include/configs/ls1021aqds.h +++ b/include/configs/ls1021aqds.h @@ -565,7 +565,6 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_LS102XA_NS_ACCESS #define CONFIG_SMP_PEN_ADDR 0x01ee0200 #define CONFIG_TIMER_CLK_FREQ 12500000 -#define CONFIG_ARMV7_SECURE_BASE OCRAM_BASE_S_ADDR #define CONFIG_HWCONFIG #define HWCONFIG_BUFFER_SIZE 128 diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h index cf2aaa3651..df7af3c82c 100644 --- a/include/configs/ls1021atwr.h +++ b/include/configs/ls1021atwr.h @@ -18,6 +18,10 @@ #define CONFIG_SKIP_LOWLEVEL_INIT #define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_DEEP_SLEEP +#ifdef CONFIG_DEEP_SLEEP +#define CONFIG_SILENT_CONSOLE +#endif /* * Size of malloc() pool @@ -95,6 +99,10 @@ #define DDR_DDR_ZQ_CNTL 0x89080600 #define DDR_CS0_CONFIG_2 0 #define DDR_SDRAM_CFG_MEM_EN 0x80000000 +#define SDRAM_CFG2_D_INIT 0x00000010 +#define DDR_CDR2_VREF_TRAIN_EN 0x00000080 +#define SDRAM_CFG2_FRC_SR 0x80000000 +#define SDRAM_CFG_BI 0x00000001 #ifdef CONFIG_RAMBOOT_PBL #define CONFIG_SYS_FSL_PBL_PBI board/freescale/ls1021atwr/ls102xa_pbi.cfg @@ -121,7 +129,8 @@ #define CONFIG_SPL_PAD_TO 0x1c000 #define CONFIG_SYS_TEXT_BASE 0x82000000 -#define CONFIG_SYS_SPL_MALLOC_START 0x80200000 +#define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_TEXT_BASE + \ + CONFIG_SYS_MONITOR_LEN) #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 #define CONFIG_SPL_BSS_START_ADDR 0x80100000 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 @@ -404,7 +413,6 @@ #define CONFIG_LS102XA_NS_ACCESS #define CONFIG_SMP_PEN_ADDR 0x01ee0200 #define CONFIG_TIMER_CLK_FREQ 12500000 -#define CONFIG_ARMV7_SECURE_BASE OCRAM_BASE_S_ADDR #define CONFIG_HWCONFIG #define HWCONFIG_BUFFER_SIZE 128 @@ -499,6 +507,7 @@ #ifdef CONFIG_SECURE_BOOT #define CONFIG_CMD_BLOB +#include <asm/fsl_secure_boot.h> #endif #endif diff --git a/include/configs/ls2085aqds.h b/include/configs/ls2085aqds.h index a6ef356ad8..91d4c5bffb 100644 --- a/include/configs/ls2085aqds.h +++ b/include/configs/ls2085aqds.h @@ -362,4 +362,17 @@ unsigned long get_board_ddr_clk(void); #endif +/* + * USB + */ +#define CONFIG_HAS_FSL_XHCI_USB +#define CONFIG_USB_XHCI +#define CONFIG_USB_XHCI_FSL +#define CONFIG_USB_XHCI_DWC3 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 +#define CONFIG_CMD_USB +#define CONFIG_USB_STORAGE +#define CONFIG_CMD_EXT2 + #endif /* __LS2_QDS_H */ diff --git a/include/configs/ls2085ardb.h b/include/configs/ls2085ardb.h index 41eb55b4bf..4f8eb13f15 100644 --- a/include/configs/ls2085ardb.h +++ b/include/configs/ls2085ardb.h @@ -295,6 +295,19 @@ unsigned long get_board_sys_clk(void); #define CONFIG_MISC_INIT_R +/* + * USB + */ +#define CONFIG_HAS_FSL_XHCI_USB +#define CONFIG_USB_XHCI +#define CONFIG_USB_XHCI_FSL +#define CONFIG_USB_XHCI_DWC3 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2 +#define CONFIG_CMD_USB +#define CONFIG_USB_STORAGE +#define CONFIG_CMD_EXT2 + /* Initial environment variables */ #undef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ diff --git a/include/fsl-mc/fsl_dpbp.h b/include/fsl-mc/fsl_dpbp.h index 7f0075c71f..3cdc94e412 100644 --- a/include/fsl-mc/fsl_dpbp.h +++ b/include/fsl-mc/fsl_dpbp.h @@ -15,7 +15,7 @@ /* DPBP Version */ #define DPBP_VER_MAJOR 2 -#define DPBP_VER_MINOR 0 +#define DPBP_VER_MINOR 1 /* Command IDs */ #define DPBP_CMDID_CLOSE 0x800 @@ -30,7 +30,7 @@ #define DPBP_CMD_OPEN(cmd, dpbp_id) \ MC_CMD_OP(cmd, 0, 0, 32, int, dpbp_id) -/* cmd, param, offset, width, type, arg_name */ +/* cmd, param, offset, width, type, arg_name */ #define DPBP_RSP_GET_ATTRIBUTES(cmd, attr) \ do { \ MC_RSP_OP(cmd, 0, 16, 16, uint16_t, attr->bpid); \ @@ -48,6 +48,7 @@ struct fsl_mc_io; /** * dpbp_open() - Open a control session for the specified object. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @dpbp_id: DPBP unique ID * @token: Returned token; use in subsequent API calls * @@ -61,11 +62,15 @@ struct fsl_mc_io; * * Return: '0' on Success; Error code otherwise. */ -int dpbp_open(struct fsl_mc_io *mc_io, int dpbp_id, uint16_t *token); +int dpbp_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpbp_id, + uint16_t *token); /** * dpbp_close() - Close the control session of the object * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * * After this function is called, no further operations are @@ -73,35 +78,60 @@ int dpbp_open(struct fsl_mc_io *mc_io, int dpbp_id, uint16_t *token); * * Return: '0' on Success; Error code otherwise. */ -int dpbp_close(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * dpbp_enable() - Enable the DPBP. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * * Return: '0' on Success; Error code otherwise. */ - -int dpbp_enable(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * dpbp_disable() - Disable the DPBP. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * * Return: '0' on Success; Error code otherwise. */ -int dpbp_disable(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * dpbp_is_enabled() - Check if the DPBP is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPBP object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ +int dpbp_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); /** * dpbp_reset() - Reset the DPBP, returns the object to initial state. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * * Return: '0' on Success; Error code otherwise. */ -int dpbp_reset(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + /** * struct dpbp_attr - Structure representing DPBP attributes @@ -124,17 +154,18 @@ struct dpbp_attr { uint16_t bpid; }; - /** * dpbp_get_attributes - Retrieve DPBP attributes. * * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * @attr: Returned object's attributes * * Return: '0' on Success; Error code otherwise. */ int dpbp_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dpbp_attr *attr); diff --git a/include/fsl-mc/fsl_dpio.h b/include/fsl-mc/fsl_dpio.h index e779909ccc..9e83a2eb43 100644 --- a/include/fsl-mc/fsl_dpio.h +++ b/include/fsl-mc/fsl_dpio.h @@ -9,7 +9,7 @@ /* DPIO Version */ #define DPIO_VER_MAJOR 3 -#define DPIO_VER_MINOR 0 +#define DPIO_VER_MINOR 1 /* Command IDs */ #define DPIO_CMDID_CLOSE 0x800 @@ -46,6 +46,7 @@ struct fsl_mc_io; /** * dpio_open() - Open a control session for the specified object * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @dpio_id: DPIO unique ID * @token: Returned token; use in subsequent API calls * @@ -59,16 +60,22 @@ struct fsl_mc_io; * * Return: '0' on Success; Error code otherwise. */ -int dpio_open(struct fsl_mc_io *mc_io, int dpio_id, uint16_t *token); +int dpio_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpio_id, + uint16_t *token); /** * dpio_close() - Close the control session of the object * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPIO object * * Return: '0' on Success; Error code otherwise. */ -int dpio_close(struct fsl_mc_io *mc_io, uint16_t token); +int dpio_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * enum dpio_channel_mode - DPIO notification channel mode @@ -85,29 +92,38 @@ enum dpio_channel_mode { /** * dpio_enable() - Enable the DPIO, allow I/O portal operations. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPIO object * * Return: '0' on Success; Error code otherwise */ -int dpio_enable(struct fsl_mc_io *mc_io, uint16_t token); +int dpio_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * dpio_disable() - Disable the DPIO, stop any I/O portal operation. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPIO object * * Return: '0' on Success; Error code otherwise */ -int dpio_disable(struct fsl_mc_io *mc_io, uint16_t token); +int dpio_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * dpio_reset() - Reset the DPIO, returns the object to initial state. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPIO object * * Return: '0' on Success; Error code otherwise. */ -int dpio_reset(struct fsl_mc_io *mc_io, uint16_t token); +int dpio_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpio_attr - Structure representing DPIO attributes @@ -141,12 +157,14 @@ struct dpio_attr { /** * dpio_get_attributes() - Retrieve DPIO attributes * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPIO object * @attr: Returned object's attributes * * Return: '0' on Success; Error code otherwise */ int dpio_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dpio_attr *attr); diff --git a/include/fsl-mc/fsl_dpmng.h b/include/fsl-mc/fsl_dpmng.h index 6feb29225d..b0a87a9082 100644 --- a/include/fsl-mc/fsl_dpmng.h +++ b/include/fsl-mc/fsl_dpmng.h @@ -14,7 +14,7 @@ struct fsl_mc_io; /** * Management Complex firmware version information */ -#define MC_VER_MAJOR 7 +#define MC_VER_MAJOR 8 #define MC_VER_MINOR 0 /** @@ -35,10 +35,13 @@ struct mc_version { * mc_get_version() - Retrieves the Management Complex firmware * version information * @mc_io: Pointer to opaque I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @mc_ver_info: Returned version information structure * * Return: '0' on Success; Error code otherwise. */ -int mc_get_version(struct fsl_mc_io *mc_io, struct mc_version *mc_ver_info); +int mc_get_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + struct mc_version *mc_ver_info); #endif /* __FSL_DPMNG_H */ diff --git a/include/fsl-mc/fsl_dpni.h b/include/fsl-mc/fsl_dpni.h index 26b67f0fb0..e9a4712c05 100644 --- a/include/fsl-mc/fsl_dpni.h +++ b/include/fsl-mc/fsl_dpni.h @@ -8,7 +8,7 @@ /* DPNI Version */ #define DPNI_VER_MAJOR 5 -#define DPNI_VER_MINOR 0 +#define DPNI_VER_MINOR 1 /* Command IDs */ #define DPNI_CMDID_OPEN 0x801 @@ -324,6 +324,7 @@ do { \ MC_CMD_OP(cmd, 0, 0, 32, int, cfg->dest_cfg.dest_id); \ MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->dest_cfg.priority);\ MC_CMD_OP(cmd, 0, 40, 2, enum dpni_dest, cfg->dest_cfg.dest_type);\ + MC_CMD_OP(cmd, 0, 42, 1, int, cfg->order_preservation_en);\ MC_CMD_OP(cmd, 0, 48, 16, uint16_t, flow_id); \ MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->user_ctx); \ MC_CMD_OP(cmd, 2, 16, 8, uint8_t, tc_id); \ @@ -350,6 +351,7 @@ do { \ MC_RSP_OP(cmd, 0, 0, 32, int, attr->dest_cfg.dest_id); \ MC_RSP_OP(cmd, 0, 32, 8, uint8_t, attr->dest_cfg.priority);\ MC_RSP_OP(cmd, 0, 40, 2, enum dpni_dest, attr->dest_cfg.dest_type); \ + MC_CMD_OP(cmd, 0, 42, 1, int, attr->order_preservation_en);\ MC_RSP_OP(cmd, 1, 0, 64, uint64_t, attr->user_ctx); \ MC_RSP_OP(cmd, 2, 32, 32, uint32_t, attr->fqid); \ MC_RSP_OP(cmd, 3, 0, 4, enum dpni_flc_type, attr->flc_cfg.flc_type); \ @@ -439,6 +441,7 @@ struct fsl_mc_io; /** * dpni_open() - Open a control session for the specified object * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @dpni_id: DPNI unique ID * @token: Returned token; use in subsequent API calls * @@ -452,11 +455,15 @@ struct fsl_mc_io; * * Return: '0' on Success; Error code otherwise. */ -int dpni_open(struct fsl_mc_io *mc_io, int dpni_id, uint16_t *token); +int dpni_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpni_id, + uint16_t *token); /** * dpni_close() - Close the control session of the object * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * * After this function is called, no further operations are @@ -464,7 +471,9 @@ int dpni_open(struct fsl_mc_io *mc_io, int dpni_id, uint16_t *token); * * Return: '0' on Success; Error code otherwise. */ -int dpni_close(struct fsl_mc_io *mc_io, uint16_t token); +int dpni_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpni_ipr_cfg - Structure representing IP reassembly configuration @@ -494,16 +503,19 @@ struct dpni_pools_cfg { * struct pools - Buffer pools parameters * @dpbp_id: DPBP object ID * @buffer_size: Buffer size + * @backup_pool: Backup pool */ struct { - int dpbp_id; - uint16_t buffer_size; + int dpbp_id; + uint16_t buffer_size; + int backup_pool; } pools[DPNI_MAX_DPBP]; }; /** * dpni_set_pools() - Set buffer pools configuration * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @cfg: Buffer pools configuration * @@ -513,36 +525,46 @@ struct dpni_pools_cfg { * Return: '0' on Success; Error code otherwise. */ int dpni_set_pools(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const struct dpni_pools_cfg *cfg); /** * dpni_enable() - Enable the DPNI, allow sending and receiving frames. - * @mc_io: Pointer to MC portal's I/O object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * * Return: '0' on Success; Error code otherwise. */ -int dpni_enable(struct fsl_mc_io *mc_io, uint16_t token); +int dpni_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * dpni_disable() - Disable the DPNI, stop sending and receiving frames. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * * Return: '0' on Success; Error code otherwise. */ -int dpni_disable(struct fsl_mc_io *mc_io, uint16_t token); +int dpni_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** - * @dpni_reset() - Reset the DPNI, returns the object to initial state. + * dpni_reset() - Reset the DPNI, returns the object to initial state. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * * Return: '0' on Success; Error code otherwise. */ -int dpni_reset(struct fsl_mc_io *mc_io, uint16_t token); +int dpni_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * struct dpni_attr - Structure representing DPNI attributes @@ -595,13 +617,15 @@ struct dpni_attr { /** * dpni_get_attributes() - Retrieve DPNI attributes. - * @mc_io: Pointer to MC portal's I/O objec + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @attr: Returned object's attributes * * Return: '0' on Success; Error code otherwise. */ int dpni_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dpni_attr *attr); @@ -648,18 +672,21 @@ struct dpni_buffer_layout { /** * dpni_get_rx_buffer_layout() - Retrieve Rx buffer layout attributes. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @layout: Returns buffer layout attributes * * Return: '0' on Success; Error code otherwise. */ int dpni_get_rx_buffer_layout(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dpni_buffer_layout *layout); /** * dpni_set_rx_buffer_layout() - Set Rx buffer layout configuration. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @layout: Buffer layout configuration * @@ -668,24 +695,28 @@ int dpni_get_rx_buffer_layout(struct fsl_mc_io *mc_io, * @warning Allowed only when DPNI is disabled */ int dpni_set_rx_buffer_layout(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const struct dpni_buffer_layout *layout); /** * dpni_get_tx_buffer_layout() - Retrieve Tx buffer layout attributes. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @layout: Returns buffer layout attributes * * Return: '0' on Success; Error code otherwise. */ int dpni_get_tx_buffer_layout(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dpni_buffer_layout *layout); /** * dpni_set_tx_buffer_layout() - Set Tx buffer layout configuration. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @layout: Buffer layout configuration * @@ -694,6 +725,7 @@ int dpni_get_tx_buffer_layout(struct fsl_mc_io *mc_io, * @warning Allowed only when DPNI is disabled */ int dpni_set_tx_buffer_layout(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const struct dpni_buffer_layout *layout); @@ -701,12 +733,14 @@ int dpni_set_tx_buffer_layout(struct fsl_mc_io *mc_io, * dpni_get_tx_conf_buffer_layout() - Retrieve Tx confirmation buffer layout * attributes. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @layout: Returns buffer layout attributes * * Return: '0' on Success; Error code otherwise. */ int dpni_get_tx_conf_buffer_layout(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dpni_buffer_layout *layout); @@ -714,6 +748,7 @@ int dpni_get_tx_conf_buffer_layout(struct fsl_mc_io *mc_io, * dpni_set_tx_conf_buffer_layout() - Set Tx confirmation buffer layout * configuration. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @layout: Buffer layout configuration * @@ -722,6 +757,7 @@ int dpni_get_tx_conf_buffer_layout(struct fsl_mc_io *mc_io, * @warning Allowed only when DPNI is disabled */ int dpni_set_tx_conf_buffer_layout(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const struct dpni_buffer_layout *layout); @@ -729,23 +765,29 @@ int dpni_set_tx_conf_buffer_layout(struct fsl_mc_io *mc_io, * dpni_get_qdid() - Get the Queuing Destination ID (QDID) that should be used * for enqueue operations * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @qdid: Returned virtual QDID value that should be used as an argument * in all enqueue operations * * Return: '0' on Success; Error code otherwise. */ -int dpni_get_qdid(struct fsl_mc_io *mc_io, uint16_t token, uint16_t *qdid); +int dpni_get_qdid(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint16_t *qdid); /** * dpni_get_tx_data_offset() - Get the Tx data offset (from start of buffer) * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @data_offset: Tx data offset (from start of buffer) * * Return: '0' on Success; Error code otherwise. */ int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint16_t *data_offset); @@ -781,6 +823,7 @@ enum dpni_counter { /** * dpni_get_counter() - Read a specific DPNI counter * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @counter: The requested counter * @value: Returned counter's current value @@ -788,6 +831,7 @@ enum dpni_counter { * Return: '0' on Success; Error code otherwise. */ int dpni_get_counter(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, enum dpni_counter counter, uint64_t *value); @@ -795,6 +839,7 @@ int dpni_get_counter(struct fsl_mc_io *mc_io, /** * dpni_set_counter() - Set (or clear) a specific DPNI counter * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @counter: The requested counter * @value: New counter value; typically pass '0' for resetting @@ -803,6 +848,7 @@ int dpni_get_counter(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpni_set_counter(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, enum dpni_counter counter, uint64_t value); @@ -829,14 +875,16 @@ struct dpni_link_cfg { /** * dpni_set_link_cfg() - set the link configuration. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @cfg: Link configuration * * Return: '0' on Success; Error code otherwise. */ -int dpni_set_link_cfg(struct fsl_mc_io *mc_io, - uint16_t token, - const struct dpni_link_cfg *cfg); +int dpni_set_link_cfg(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + const struct dpni_link_cfg *cfg); /** * struct dpni_link_state - Structure representing DPNI link state @@ -853,60 +901,70 @@ struct dpni_link_state { /** * dpni_get_link_state() - Return the link state (either up or down) * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @state: Returned link state; * * Return: '0' on Success; Error code otherwise. */ -int dpni_get_link_state(struct fsl_mc_io *mc_io, - uint16_t token, - struct dpni_link_state *state); +int dpni_get_link_state(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpni_link_state *state); /** * dpni_set_primary_mac_addr() - Set the primary MAC address * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @mac_addr: MAC address to set as primary address * * Return: '0' on Success; Error code otherwise. */ -int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io, +int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const uint8_t mac_addr[6]); /** * dpni_get_primary_mac_addr() - Get the primary MAC address * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @mac_addr: Returned MAC address * * Return: '0' on Success; Error code otherwise. */ int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t mac_addr[6]); /** * dpni_add_mac_addr() - Add MAC address filter * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @mac_addr: MAC address to add * * Return: '0' on Success; Error code otherwise. */ int dpni_add_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const uint8_t mac_addr[6]); /** * dpni_remove_mac_addr() - Remove MAC address filter * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @mac_addr: MAC address to remove * * Return: '0' on Success; Error code otherwise. */ int dpni_remove_mac_addr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const uint8_t mac_addr[6]); @@ -1005,7 +1063,8 @@ struct dpni_flc_cfg { * not applicable for Tx-conf/Err queues as the FD comes from the user */ #define DPNI_QUEUE_OPT_FLC 0x00000004 - +/* Select to modify the queue's order preservation */ +#define DPNI_QUEUE_OPT_ORDER_PRESERVATION 0x00000008 /** * struct dpni_queue_cfg - Structure representing queue configuration @@ -1021,12 +1080,16 @@ struct dpni_flc_cfg { * in the case of FS (flow-steering) the flow's FLC settings * are used. * valid only if 'DPNI_QUEUE_OPT_FLC' is contained in 'options' + * @order_preservation_en: enable/disable order preservation; + * valid only if 'DPNI_QUEUE_OPT_ORDER_PRESERVATION' is contained + * in 'options' */ struct dpni_queue_cfg { uint32_t options; uint64_t user_ctx; struct dpni_dest_cfg dest_cfg; struct dpni_flc_cfg flc_cfg; + int order_preservation_en; }; /** @@ -1035,12 +1098,14 @@ struct dpni_queue_cfg { * dequeued frame * @dest_cfg: Queue destination configuration * @flc_cfg: Flow context configuration + * @order_preservation_en: enable/disable order preservation * @fqid: Virtual fqid value to be used for dequeue operations */ struct dpni_queue_attr { uint64_t user_ctx; struct dpni_dest_cfg dest_cfg; struct dpni_flc_cfg flc_cfg; + int order_preservation_en; uint32_t fqid; }; @@ -1100,6 +1165,7 @@ struct dpni_tx_flow_cfg { /** * dpni_set_tx_flow() - Set Tx flow configuration * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @flow_id: Provides (or returns) the sender's flow ID; * for each new sender set (*flow_id) to @@ -1111,6 +1177,7 @@ struct dpni_tx_flow_cfg { * Return: '0' on Success; Error code otherwise. */ int dpni_set_tx_flow(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint16_t *flow_id, const struct dpni_tx_flow_cfg *cfg); @@ -1144,6 +1211,7 @@ struct dpni_tx_flow_attr { /** * dpni_get_tx_flow() - Get Tx flow attributes * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @flow_id: The sender's flow ID, as returned by the * dpni_set_tx_flow() function @@ -1152,6 +1220,7 @@ struct dpni_tx_flow_attr { * Return: '0' on Success; Error code otherwise. */ int dpni_get_tx_flow(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint16_t flow_id, struct dpni_tx_flow_attr *attr); @@ -1159,10 +1228,11 @@ int dpni_get_tx_flow(struct fsl_mc_io *mc_io, /** * dpni_set_rx_flow() - Set Rx flow configuration * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @tc_id: Traffic class selection (0-7); * use 'DPNI_ALL_TCS' to set all TCs and all flows - * @flow_id Rx flow id within the traffic class; use + * @flow_id: Rx flow id within the traffic class; use * 'DPNI_ALL_TC_FLOWS' to set all flows within * this tc_id; ignored if tc_id is set to * 'DPNI_ALL_TCS'; @@ -1171,6 +1241,7 @@ int dpni_get_tx_flow(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpni_set_rx_flow(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t tc_id, uint16_t flow_id, @@ -1179,6 +1250,7 @@ int dpni_set_rx_flow(struct fsl_mc_io *mc_io, /** * dpni_get_rx_flow() - Get Rx flow attributes * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @tc_id: Traffic class selection (0-7) * @flow_id: Rx flow id within the traffic class @@ -1187,6 +1259,7 @@ int dpni_set_rx_flow(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpni_get_rx_flow(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t tc_id, uint16_t flow_id, diff --git a/include/fsl-mc/fsl_dprc.h b/include/fsl-mc/fsl_dprc.h index 26a4598b61..b2cd2cb160 100644 --- a/include/fsl-mc/fsl_dprc.h +++ b/include/fsl-mc/fsl_dprc.h @@ -10,7 +10,7 @@ #define _FSL_DPRC_H /* DPRC Version */ -#define DPRC_VER_MAJOR 4 +#define DPRC_VER_MAJOR 5 #define DPRC_VER_MINOR 0 /* Command IDs */ @@ -191,14 +191,16 @@ do { \ /* param, offset, width, type, arg_name */ #define DPRC_RSP_GET_OBJ_REGION(cmd, region_desc) \ do { \ - MC_RSP_OP(cmd, 1, 0, 64, uint64_t, region_desc->base_offset);\ + MC_RSP_OP(cmd, 1, 0, 32, uint32_t, region_desc->base_offset);\ MC_RSP_OP(cmd, 2, 0, 32, uint32_t, region_desc->size); \ + MC_RSP_OP(cmd, 2, 32, 4, enum dprc_region_type, region_desc->type);\ + MC_RSP_OP(cmd, 3, 0, 32, uint32_t, region_desc->flags);\ } while (0) /* cmd, param, offset, width, type, arg_name */ -#define DPRC_CMD_SET_OBJ_LABEL(cmd, obj_index, label) \ +#define DPRC_CMD_SET_OBJ_LABEL(cmd, obj_type, obj_id, label) \ do { \ - MC_CMD_OP(cmd, 0, 0, 32, int, obj_index); \ + MC_CMD_OP(cmd, 0, 0, 32, int, obj_id); \ MC_CMD_OP(cmd, 1, 0, 8, char, label[0]);\ MC_CMD_OP(cmd, 1, 8, 8, char, label[1]);\ MC_CMD_OP(cmd, 1, 16, 8, char, label[2]);\ @@ -215,15 +217,31 @@ do { \ MC_CMD_OP(cmd, 2, 40, 8, char, label[13]);\ MC_CMD_OP(cmd, 2, 48, 8, char, label[14]);\ MC_CMD_OP(cmd, 2, 56, 8, char, label[15]);\ + MC_CMD_OP(cmd, 3, 0, 8, char, obj_type[0]);\ + MC_CMD_OP(cmd, 3, 8, 8, char, obj_type[1]);\ + MC_CMD_OP(cmd, 3, 16, 8, char, obj_type[2]);\ + MC_CMD_OP(cmd, 3, 24, 8, char, obj_type[3]);\ + MC_CMD_OP(cmd, 3, 32, 8, char, obj_type[4]);\ + MC_CMD_OP(cmd, 3, 40, 8, char, obj_type[5]);\ + MC_CMD_OP(cmd, 3, 48, 8, char, obj_type[6]);\ + MC_CMD_OP(cmd, 3, 56, 8, char, obj_type[7]);\ + MC_CMD_OP(cmd, 4, 0, 8, char, obj_type[8]);\ + MC_CMD_OP(cmd, 4, 8, 8, char, obj_type[9]);\ + MC_CMD_OP(cmd, 4, 16, 8, char, obj_type[10]);\ + MC_CMD_OP(cmd, 4, 24, 8, char, obj_type[11]);\ + MC_CMD_OP(cmd, 4, 32, 8, char, obj_type[12]);\ + MC_CMD_OP(cmd, 4, 40, 8, char, obj_type[13]);\ + MC_CMD_OP(cmd, 4, 48, 8, char, obj_type[14]);\ + MC_CMD_OP(cmd, 4, 56, 8, char, obj_type[15]);\ } while (0) /* cmd, param, offset, width, type, arg_name */ -#define DPRC_CMD_CONNECT(cmd, endpoint1, endpoint2) \ +#define DPRC_CMD_CONNECT(cmd, endpoint1, endpoint2, cfg) \ do { \ MC_CMD_OP(cmd, 0, 0, 32, int, endpoint1->id); \ - MC_CMD_OP(cmd, 0, 32, 32, int, endpoint1->interface_id); \ + MC_CMD_OP(cmd, 0, 32, 16, uint16_t, endpoint1->if_id); \ MC_CMD_OP(cmd, 1, 0, 32, int, endpoint2->id); \ - MC_CMD_OP(cmd, 1, 32, 32, int, endpoint2->interface_id); \ + MC_CMD_OP(cmd, 1, 32, 16, uint16_t, endpoint2->if_id); \ MC_CMD_OP(cmd, 2, 0, 8, char, endpoint1->type[0]); \ MC_CMD_OP(cmd, 2, 8, 8, char, endpoint1->type[1]); \ MC_CMD_OP(cmd, 2, 16, 8, char, endpoint1->type[2]); \ @@ -240,6 +258,8 @@ do { \ MC_CMD_OP(cmd, 3, 40, 8, char, endpoint1->type[13]); \ MC_CMD_OP(cmd, 3, 48, 8, char, endpoint1->type[14]); \ MC_CMD_OP(cmd, 3, 56, 8, char, endpoint1->type[15]); \ + MC_CMD_OP(cmd, 4, 0, 32, uint32_t, cfg->max_rate); \ + MC_CMD_OP(cmd, 4, 32, 32, uint32_t, cfg->committed_rate); \ MC_CMD_OP(cmd, 5, 0, 8, char, endpoint2->type[0]); \ MC_CMD_OP(cmd, 5, 8, 8, char, endpoint2->type[1]); \ MC_CMD_OP(cmd, 5, 16, 8, char, endpoint2->type[2]); \ @@ -262,7 +282,7 @@ do { \ #define DPRC_CMD_DISCONNECT(cmd, endpoint) \ do { \ MC_CMD_OP(cmd, 0, 0, 32, int, endpoint->id); \ - MC_CMD_OP(cmd, 0, 32, 32, int, endpoint->interface_id); \ + MC_CMD_OP(cmd, 0, 32, 16, uint16_t, endpoint->if_id); \ MC_CMD_OP(cmd, 1, 0, 8, char, endpoint->type[0]); \ MC_CMD_OP(cmd, 1, 8, 8, char, endpoint->type[1]); \ MC_CMD_OP(cmd, 1, 16, 8, char, endpoint->type[2]); \ @@ -285,7 +305,7 @@ do { \ #define DPRC_CMD_GET_CONNECTION(cmd, endpoint1) \ do { \ MC_CMD_OP(cmd, 0, 0, 32, int, endpoint1->id); \ - MC_CMD_OP(cmd, 0, 32, 32, int, endpoint1->interface_id); \ + MC_CMD_OP(cmd, 0, 32, 16, uint16_t, endpoint1->if_id); \ MC_CMD_OP(cmd, 1, 0, 8, char, endpoint1->type[0]); \ MC_CMD_OP(cmd, 1, 8, 8, char, endpoint1->type[1]); \ MC_CMD_OP(cmd, 1, 16, 8, char, endpoint1->type[2]); \ @@ -304,12 +324,11 @@ do { \ MC_CMD_OP(cmd, 2, 56, 8, char, endpoint1->type[15]); \ } while (0) - /* cmd, param, offset, width, type, arg_name */ #define DPRC_RSP_GET_CONNECTION(cmd, endpoint2, state) \ do { \ MC_RSP_OP(cmd, 3, 0, 32, int, endpoint2->id); \ - MC_RSP_OP(cmd, 3, 32, 32, int, endpoint2->interface_id); \ + MC_RSP_OP(cmd, 3, 32, 16, uint16_t, endpoint2->if_id); \ MC_RSP_OP(cmd, 4, 0, 8, char, endpoint2->type[0]); \ MC_RSP_OP(cmd, 4, 8, 8, char, endpoint2->type[1]); \ MC_RSP_OP(cmd, 4, 16, 8, char, endpoint2->type[2]); \ @@ -351,16 +370,20 @@ struct fsl_mc_io; /** * dprc_get_container_id() - Get container ID associated with a given portal. - * @mc_io: Pointer to MC portal's I/O object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @container_id: Requested container ID * * Return: '0' on Success; Error code otherwise. */ -int dprc_get_container_id(struct fsl_mc_io *mc_io, int *container_id); +int dprc_get_container_id(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int *container_id); /** * dprc_open() - Open DPRC object for use * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @container_id: Container ID to open * @token: Returned token of DPRC object * @@ -368,11 +391,15 @@ int dprc_get_container_id(struct fsl_mc_io *mc_io, int *container_id); * * @warning Required before any operation on the object. */ -int dprc_open(struct fsl_mc_io *mc_io, int container_id, uint16_t *token); +int dprc_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int container_id, + uint16_t *token); /** * dprc_close() - Close the control session of the object * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object * * After this function is called, no further operations are @@ -380,7 +407,9 @@ int dprc_open(struct fsl_mc_io *mc_io, int container_id, uint16_t *token); * * Return: '0' on Success; Error code otherwise. */ -int dprc_close(struct fsl_mc_io *mc_io, uint16_t token); +int dprc_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * Container general options @@ -440,6 +469,7 @@ struct dprc_cfg { /** * dprc_reset_container - Reset child container. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object * @child_container_id: ID of the container to reset * @@ -458,9 +488,10 @@ struct dprc_cfg { * * Return: '0' on Success; Error code otherwise. */ -int dprc_reset_container(struct fsl_mc_io *mc_io, - uint16_t token, - int child_container_id); +int dprc_reset_container(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int child_container_id); /** * struct dprc_attributes - Container attributes @@ -489,24 +520,30 @@ struct dprc_attributes { /** * dprc_get_attributes() - Obtains container attributes * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object - * @attributes Returned container attributes + * @attributes: Returned container attributes * * Return: '0' on Success; Error code otherwise. */ int dprc_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dprc_attributes *attributes); /** * dprc_get_obj_count() - Obtains the number of objects in the DPRC * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object * @obj_count: Number of objects assigned to the DPRC * * Return: '0' on Success; Error code otherwise. */ -int dprc_get_obj_count(struct fsl_mc_io *mc_io, uint16_t token, int *obj_count); +int dprc_get_obj_count(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *obj_count); /* Objects Attributes Flags */ @@ -542,6 +579,7 @@ struct dprc_obj_desc { /** * dprc_get_obj() - Get general information on an object * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object * @obj_index: Index of the object to be queried (< obj_count) * @obj_desc: Returns the requested object descriptor @@ -554,6 +592,7 @@ struct dprc_obj_desc { * Return: '0' on Success; Error code otherwise. */ int dprc_get_obj(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, int obj_index, struct dprc_obj_desc *obj_desc); @@ -562,6 +601,7 @@ int dprc_get_obj(struct fsl_mc_io *mc_io, * dprc_get_res_count() - Obtains the number of free resources that are * assigned to this container, by pool type * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object * @type: pool type * @res_count: Returned number of free resources of the given @@ -569,7 +609,8 @@ int dprc_get_obj(struct fsl_mc_io *mc_io, * * Return: '0' on Success; Error code otherwise. */ -int dprc_get_res_count(struct fsl_mc_io *mc_io, +int dprc_get_res_count(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, char *type, int *res_count); @@ -604,6 +645,7 @@ struct dprc_res_ids_range_desc { /** * dprc_get_res_ids() - Obtains IDs of free resources in the container * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object * @type: pool type * @range_desc: range descriptor @@ -611,10 +653,25 @@ struct dprc_res_ids_range_desc { * Return: '0' on Success; Error code otherwise. */ int dprc_get_res_ids(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, char *type, struct dprc_res_ids_range_desc *range_desc); +/* Region flags */ +/* Cacheable - Indicates that region should be mapped as cacheable */ +#define DPRC_REGION_CACHEABLE 0x00000001 + +/** + * enum dprc_region_type - Region type + * @DPRC_REGION_TYPE_MC_PORTAL: MC portal region + * @DPRC_REGION_TYPE_QBMAN_PORTAL: Qbman portal region + */ +enum dprc_region_type { + DPRC_REGION_TYPE_MC_PORTAL, + DPRC_REGION_TYPE_QBMAN_PORTAL +}; + /** * struct dprc_region_desc - Mappable region descriptor * @base_offset: Region offset from region's base address. @@ -622,17 +679,22 @@ int dprc_get_res_ids(struct fsl_mc_io *mc_io, * base address; For DPIO, region base is offset from SoC QMan portals * base address * @size: Region size (in bytes) + * @flags: Region attributes + * @type: Portal region type */ struct dprc_region_desc { - uint64_t base_offset; + uint32_t base_offset; uint32_t size; + uint32_t flags; + enum dprc_region_type type; }; /** * dprc_get_obj_region() - Get region information for a specified object. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object - * @obj_type; Object type as returned in dprc_get_obj() + * @obj_type: Object type as returned in dprc_get_obj() * @obj_id: Unique object instance as returned in dprc_get_obj() * @region_index: The specific region to query * @region_desc: Returns the requested region descriptor @@ -640,6 +702,7 @@ struct dprc_region_desc { * Return: '0' on Success; Error code otherwise. */ int dprc_get_obj_region(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, char *obj_type, int obj_id, @@ -650,53 +713,74 @@ int dprc_get_obj_region(struct fsl_mc_io *mc_io, * operations * @type: Endpoint object type: NULL terminated string * @id: Endpoint object ID - * @interface_id: Interface ID; should be set for endpoints with multiple + * @if_id: Interface ID; should be set for endpoints with multiple * interfaces ("dpsw", "dpdmux"); for others, always set to 0 */ struct dprc_endpoint { - char type[16]; - int id; - int interface_id; + char type[16]; + int id; + uint16_t if_id; +}; + +/** + * struct dprc_connection_cfg - Connection configuration. + * Used for virtual connections only + * @committed_rate: Committed rate (Mbits/s) + * @max_rate: Maximum rate (Mbits/s) + */ +struct dprc_connection_cfg { + uint32_t committed_rate; + uint32_t max_rate; }; /** * dprc_connect() - Connect two endpoints to create a network link between them * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object * @endpoint1: Endpoint 1 configuration parameters * @endpoint2: Endpoint 2 configuration parameters + * @cfg: Connection configuration. The connection configuration is ignored for + * connections made to DPMAC objects, where rate is retrieved from the + * MAC configuration. * * Return: '0' on Success; Error code otherwise. */ -int dprc_connect(struct fsl_mc_io *mc_io, - uint16_t token, - const struct dprc_endpoint *endpoint1, - const struct dprc_endpoint *endpoint2); +int dprc_connect(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + const struct dprc_endpoint *endpoint1, + const struct dprc_endpoint *endpoint2, + const struct dprc_connection_cfg *cfg); /** * dprc_disconnect() - Disconnect one endpoint to remove its network connection * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPRC object * @endpoint: Endpoint configuration parameters * * Return: '0' on Success; Error code otherwise. */ int dprc_disconnect(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const struct dprc_endpoint *endpoint); /** * dprc_get_connection() - Get connected endpoint and link status if connection * exists. -* @mc_io Pointer to MC portal's I/O object -* @token Token of DPRC object -* @endpoint1 Endpoint 1 configuration parameters -* @endpoint2 Returned endpoint 2 configuration parameters +* @mc_io: Pointer to MC portal's I/O object +* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' +* @token: Token of DPRC object +* @endpoint1: Endpoint 1 configuration parameters +* @endpoint2: Returned endpoint 2 configuration parameters * @state: Returned link state: 1 - link is up, 0 - link is down * * Return: '0' on Success; -ENAVAIL if connection does not exist. */ int dprc_get_connection(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, const struct dprc_endpoint *endpoint1, struct dprc_endpoint *endpoint2, diff --git a/include/fsl-mc/fsl_mc_cmd.h b/include/fsl-mc/fsl_mc_cmd.h index cb39c39722..7f87d4e302 100644 --- a/include/fsl-mc/fsl_mc_cmd.h +++ b/include/fsl-mc/fsl_mc_cmd.h @@ -10,11 +10,11 @@ #define MAKE_UMASK64(_width) \ ((uint64_t)((_width) < 64 ? ((uint64_t)1 << (_width)) - 1 : -1)) -static inline uint64_t u64_enc(int lsoffset, int width, uint64_t val) +static inline uint64_t mc_enc(int lsoffset, int width, uint64_t val) { return (uint64_t)(((uint64_t)val & MAKE_UMASK64(width)) << lsoffset); } -static inline uint64_t u64_dec(uint64_t val, int lsoffset, int width) +static inline uint64_t mc_dec(uint64_t val, int lsoffset, int width) { return (uint64_t)((val >> lsoffset) & MAKE_UMASK64(width)); } @@ -39,44 +39,55 @@ enum mc_cmd_status { MC_CMD_STATUS_INVALID_STATE = 0xC /*!< Invalid state */ }; +/* + * MC command flags + */ + +/* High priority flag */ +#define MC_CMD_FLAG_PRI 0x00008000 +/* No flags */ +#define MC_CMD_NO_FLAGS 0x00000000 +/* Command completion flag */ +#define MC_CMD_FLAG_INTR_DIS 0x01000000 + + #define MC_CMD_HDR_CMDID_O 52 /* Command ID field offset */ #define MC_CMD_HDR_CMDID_S 12 /* Command ID field size */ #define MC_CMD_HDR_STATUS_O 16 /* Status field offset */ #define MC_CMD_HDR_TOKEN_O 38 /* Token field offset */ #define MC_CMD_HDR_TOKEN_S 10 /* Token field size */ #define MC_CMD_HDR_STATUS_S 8 /* Status field size*/ -#define MC_CMD_HDR_PRI_O 15 /* Priority field offset */ -#define MC_CMD_HDR_PRI_S 1 /* Priority field size */ +#define MC_CMD_HDR_FLAGS_O 0 /* Flags field offset */ +#define MC_CMD_HDR_FLAGS_S 32 /* Flags field size*/ +#define MC_CMD_HDR_FLAGS_MASK 0xFF00FF00 /* Command flags mask */ #define MC_CMD_HDR_READ_STATUS(_hdr) \ - ((enum mc_cmd_status)u64_dec((_hdr), \ + ((enum mc_cmd_status)mc_dec((_hdr), \ MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S)) #define MC_CMD_HDR_READ_TOKEN(_hdr) \ - ((uint16_t)u64_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S)) - -#define MC_CMD_PRI_LOW 0 /*!< Low Priority command indication */ -#define MC_CMD_PRI_HIGH 1 /*!< High Priority command indication */ + ((uint16_t)mc_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S)) #define MC_EXT_OP(_ext, _param, _offset, _width, _type, _arg) \ - ((_ext)[_param] |= u64_enc((_offset), (_width), _arg)) + ((_ext)[_param] |= mc_enc((_offset), (_width), _arg)) #define MC_CMD_OP(_cmd, _param, _offset, _width, _type, _arg) \ - ((_cmd).params[_param] |= u64_enc((_offset), (_width), _arg)) + ((_cmd).params[_param] |= mc_enc((_offset), (_width), _arg)) #define MC_RSP_OP(_cmd, _param, _offset, _width, _type, _arg) \ - (_arg = (_type)u64_dec(_cmd.params[_param], (_offset), (_width))) + (_arg = (_type)mc_dec(_cmd.params[_param], (_offset), (_width))) static inline uint64_t mc_encode_cmd_header(uint16_t cmd_id, - uint8_t priority, + uint32_t cmd_flags, uint16_t token) { uint64_t hdr; - hdr = u64_enc(MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S, cmd_id); - hdr |= u64_enc(MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S, token); - hdr |= u64_enc(MC_CMD_HDR_PRI_O, MC_CMD_HDR_PRI_S, priority); - hdr |= u64_enc(MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S, + hdr = mc_enc(MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S, cmd_id); + hdr |= mc_enc(MC_CMD_HDR_FLAGS_O, MC_CMD_HDR_FLAGS_S, + (cmd_flags & MC_CMD_HDR_FLAGS_MASK)); + hdr |= mc_enc(MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S, token); + hdr |= mc_enc(MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S, MC_CMD_STATUS_READY); return hdr; @@ -130,6 +141,4 @@ static inline enum mc_cmd_status mc_read_response( return status; } -int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd); - #endif /* __FSL_MC_CMD_H */ diff --git a/include/fsl_ddr.h b/include/fsl_ddr.h index 728503b62c..1ac092bb92 100644 --- a/include/fsl_ddr.h +++ b/include/fsl_ddr.h @@ -103,7 +103,7 @@ unsigned int compute_lowest_common_dimm_parameters( const dimm_params_t *dimm_params, common_timing_params_t *outpdimm, unsigned int number_of_dimms); -unsigned int populate_memctl_options(int all_dimms_registered, +unsigned int populate_memctl_options(const common_timing_params_t *common_dimm, memctl_options_t *popts, dimm_params_t *pdimm, unsigned int ctrl_num); diff --git a/include/fsl_sec.h b/include/fsl_sec.h index ebb1ac6d40..672bcef2f3 100644 --- a/include/fsl_sec.h +++ b/include/fsl_sec.h @@ -32,10 +32,20 @@ /* RNG4 TRNG test registers */ struct rng4tst { #define RTMCTL_PRGM 0x00010000 /* 1 -> program mode, 0 -> run mode */ +#define RTMCTL_SAMP_MODE_VON_NEUMANN_ES_SC 0 /* use von Neumann data in + both entropy shifter and + statistical checker */ +#define RTMCTL_SAMP_MODE_RAW_ES_SC 1 /* use raw data in both + entropy shifter and + statistical checker */ +#define RTMCTL_SAMP_MODE_VON_NEUMANN_ES_RAW_SC 2 /* use von Neumann data in + entropy shifter, raw data + in statistical checker */ +#define RTMCTL_SAMP_MODE_INVALID 3 /* invalid combination */ u32 rtmctl; /* misc. control register */ u32 rtscmisc; /* statistical check misc. register */ u32 rtpkrrng; /* poker range register */ -#define RTSDCTL_ENT_DLY_MIN 1200 +#define RTSDCTL_ENT_DLY_MIN 3200 #define RTSDCTL_ENT_DLY_MAX 12800 union { u32 rtpkrmax; /* PRGM=1: poker max. limit register */ @@ -49,6 +59,7 @@ struct rng4tst { u32 rttotsam; /* PRGM=0: total samples register */ }; u32 rtfreqmin; /* frequency count min. limit register */ +#define RTFRQMAX_DISABLE (1 << 20) union { u32 rtfreqmax; /* PRGM=1: freq. count max. limit register */ u32 rtfreqcnt; /* PRGM=0: freq. count register */ diff --git a/include/pci.h b/include/pci.h index 94bca97512..dce159f277 100644 --- a/include/pci.h +++ b/include/pci.h @@ -11,6 +11,9 @@ #ifndef _PCI_H #define _PCI_H +#define PCI_CFG_SPACE_SIZE 256 +#define PCI_CFG_SPACE_EXP_SIZE 4096 + /* * Under PCI, each device has 256 bytes of configuration address space, * of which the first 64 bytes are standardized as follows: @@ -413,6 +416,39 @@ #define PCI_FIND_CAP_TTL 0x48 #define CAP_START_POS 0x40 +/* Extended Capabilities (PCI-X 2.0 and Express) */ +#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff) +#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) +#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) + +#define PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error Reporting */ +#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel Capability */ +#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */ +#define PCI_EXT_CAP_ID_PWR 0x04 /* Power Budgeting */ +#define PCI_EXT_CAP_ID_RCLD 0x05 /* Root Complex Link Declaration */ +#define PCI_EXT_CAP_ID_RCILC 0x06 /* Root Complex Internal Link Control */ +#define PCI_EXT_CAP_ID_RCEC 0x07 /* Root Complex Event Collector */ +#define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */ +#define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */ +#define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */ +#define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor-Specific */ +#define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */ +#define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */ +#define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */ +#define PCI_EXT_CAP_ID_ATS 0x0F /* Address Translation Services */ +#define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */ +#define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */ +#define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */ +#define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */ +#define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* Reserved for AMD */ +#define PCI_EXT_CAP_ID_REBAR 0x15 /* Resizable BAR */ +#define PCI_EXT_CAP_ID_DPA 0x16 /* Dynamic Power Allocation */ +#define PCI_EXT_CAP_ID_TPH 0x17 /* TPH Requester */ +#define PCI_EXT_CAP_ID_LTR 0x18 /* Latency Tolerance Reporting */ +#define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe Capability */ +#define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */ +#define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */ + /* Include the ID list */ #include <pci_ids.h> @@ -687,6 +723,11 @@ extern int pci_hose_find_cap_start(struct pci_controller *hose, pci_dev_t dev, extern int pci_find_cap(struct pci_controller *hose, pci_dev_t dev, int pos, int cap); +int pci_find_next_ext_capability(struct pci_controller *hose, + pci_dev_t dev, int start, int cap); +int pci_hose_find_ext_capability(struct pci_controller *hose, + pci_dev_t dev, int cap); + #ifdef CONFIG_PCI_FIXUP_DEV extern void board_pci_fixup_dev(struct pci_controller *hose, pci_dev_t dev, unsigned short vendor, diff --git a/include/tsec.h b/include/tsec.h index 58cdc19df3..1119d2cb60 100644 --- a/include/tsec.h +++ b/include/tsec.h @@ -129,11 +129,7 @@ #define MINFLR_INIT_SETTINGS 0x00000040 -#ifdef CONFIG_LS102XA -#define DMACTRL_INIT_SETTINGS 0x00000003 -#else #define DMACTRL_INIT_SETTINGS 0x000000c3 -#endif #define DMACTRL_GRS 0x00000010 #define DMACTRL_GTS 0x00000008 #define DMACTRL_LE 0x00008000 |