Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mss_sgmii: likely typo? #31

Open
eenurkka opened this issue Sep 7, 2021 · 2 comments
Open

mss_sgmii: likely typo? #31

eenurkka opened this issue Sep 7, 2021 · 2 comments

Comments

@eenurkka
Copy link

eenurkka commented Sep 7, 2021

In the file: baremetal/polarfire-soc-bare-metal-library/src/platform/mpfs_hal/common/nwc/mss_sgmii.c:

There's a duplicate line, should the other be MSS_PERIPH_MAC1 instead of MSS_PERIPH_MAC0?

        (void)mss_config_clk_rst(MSS_PERIPH_MAC0, (uint8_t) MPFS_HAL_FIRST_HART, PERIPHERAL_ON);
        (void)mss_config_clk_rst(MSS_PERIPH_MAC0, (uint8_t) MPFS_HAL_FIRST_HART, PERIPHERAL_ON);
        GEM_A_LO->network_config |= (0x01U << 10U) | (0x01U << 11U);   /* GEM0 */
        GEM_B_LO->network_config |= (0x01U << 10U) | (0x01U << 11U);   /* GEM1 */
@eenurkka
Copy link
Author

eenurkka commented Sep 7, 2021

This seems to be writing in the NETWORK_STATUS register (which is RO), although one would expect a write in the NETWORK_CONFIG -register?

        GEM_A_LO->network_config |= (0x01U << 10U) | (0x01U << 11U);   /* GEM0 */
        GEM_B_LO->network_config |= (0x01U << 10U) | (0x01U << 11U);   /* GEM1 */

mss_sgmii.h file declares the base 4 bytes ahead of what's on the specs (ought to be 0x20110000 and 0x20112000 instead?):

#define GEM_A_LO_BASE 0x20110004UL
#define GEM_B_LO_BASE 0x20112004UL

typedef struct IOSCB_GEM_X_LO_STRUCT_ {
__IO uint32_t network_control; /* The network configuration register contains functions for setting the mode of operation for the Gigabit Ethernet MAC. /
__IO uint32_t network_config; /
/
__IO uint32_t network_status; /
/
__IO uint32_t dma_config; /
/
__IO uint32_t transmit_status; /
/
__IO uint32_t receive_q_ptr; /
*/
} IOSCB_GEM_X_LO_STRUCT;

#define GEM_A_LO ((volatile IOSCB_GEM_X_LO_STRUCT *) GEM_A_LO_BASE)
#define GEM_B_LO ((volatile IOSCB_GEM_X_LO_STRUCT *) GEM_B_LO_BASE)

@griffini
Copy link
Collaborator

griffini commented Sep 7, 2021

Thanks for reporting these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants