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

risc-v/mpfs: emmcsd: enforce HS SDR mode properly #101

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
20bc463
drivers/can/can.c: Change size_t type printf formatter %d -> %zu
haitomatic Oct 31, 2022
c742d5d
mm/mempool/mempool_multiple.c: Remove void * arithmetic
jlaitine Jan 18, 2023
54d6d07
boards/riscv/mpfs/icicle/configs/standalone: Add a standalone target
jlaitine Nov 22, 2021
95e7b51
mpfs: i2c: Fix reset and interrupt issues
jpaali Dec 9, 2021
af79b1f
Fix the check workflow for tiiuae repo
jlaitine Nov 24, 2021
4da21c5
Normalize boards/risc-v/esp32c3/esp32c3-devkit/configs/mcuboot_slot_c…
jlaitine Mar 21, 2022
bd0646f
arch/risc-v/src/opensbi/Make.defs: Switch opensbi to the nuttx/size o…
jlaitine Jul 21, 2022
31ffe8a
[REVERTME] arch/risc-v/src/mpfs/mpfs_ethernet.c: Hack the ethernet dr…
jlaitine Aug 17, 2022
7a74ad8
[HACK] Set SD-card speed to 50MHz
jlaitine Sep 14, 2022
257c099
opensbi: Take SBI version that removes console into use
pussuw Sep 20, 2022
b4dde43
Fix standalone defconfig for CI
jlaitine Sep 28, 2022
73c62dd
arch/risc-v/src/mpfs/mpfs_clockconfig.c: Flag out code only used in b…
jlaitine Sep 28, 2022
b88a9ef
arch/risc-v/src/mpfs: Add mpfs canfd socket can driver
haitomatic May 26, 2022
e0a0c62
boards/risc-v/mpfs/icicle: add new target for testing mpfs canfd driver
haitomatic Jun 15, 2022
dd68f85
mpfs/emmcsd: Set same base clock for SDR/DDR modes
pussuw Nov 30, 2022
f1e0380
mpfs/emmcsd: [HACK] Set 8-bit data width and DDR HS mode for eMMC
pussuw Nov 30, 2022
8c97579
mpfs/emmcsd: Fix build issue with 8-bit HS mode
pussuw Nov 30, 2022
5539af8
Fix build.yml
jpaali Dec 12, 2022
8fc7d62
risc-v/mpfs: ihc: Make IHC HSS workaround configurable
jpaali Sep 9, 2022
df9d0c9
drivers/net/rpmsgdrv.c: Take netdev_register() return value into account
jpaali Sep 27, 2022
c687b91
drivers/net/rpmsgdrv.c: Support only TRANSFER commands
jpaali Dec 13, 2022
2cdb59d
arch/risc-v/src/mpfs/mpfs_ihc.c: Increase RPMSG buffer size
jpaali Nov 30, 2022
8c104c9
mpfs_ihc: Make Vring addresses configurable
jpaali Dec 2, 2022
d865823
Revert "openamp: don't depend on pen-amp.zip and libmetal.zip in the …
jpaali Dec 12, 2022
88daec5
Revert "rptun: fix rptun don't wait issue when get tx patyload"
jpaali Dec 12, 2022
c859823
Revert "openamp: update openmap lib version to 2022.10.0"
jpaali Dec 12, 2022
30bd331
arch/arm/src/stm32f7/stm32_i2c.c: Driver cleanup
jnippula Jan 13, 2023
911724b
Revert "rpmsg_socket: release tx buffer when send_oncopy failed"
jlaitine Jan 18, 2023
f2d0dfd
arch/risc-v/src/mpfs/mpfs_fpga_canfd.c: Fix CONFIG_DEBUG_CAN_INFO ifd…
jlaitine Jan 19, 2023
5d0a419
boards/risc-v/mpfs/icicle/configs/canfd/defconfig: Normalize
jlaitine Jan 19, 2023
5e44d38
arch/mpfs: Make selection of SBI boot or direct boot run-time configu…
jlaitine Jan 17, 2023
5668467
remove devif_loopback in canfd driver since it is now devif_poll func…
haitomatic Jan 19, 2023
fe6f687
arch/arm/src/stm32f7/stm32_i2c.c: Round up stm32_i2c_toticks return v…
jlaitine Jan 27, 2023
2d76d75
Merge pull request #85 from tiiuae/canfd_driver_net_fix
haitomatic Jan 30, 2023
6649979
include/nuttx/clock.h: Change ?SEC2TICK macros to round up and fix nx…
jlaitine Jan 30, 2023
0eefd7d
Revert "arch/arm/src/stm32f7/stm32_i2c.c: Round up stm32_i2c_toticks …
jlaitine Jan 30, 2023
a39ad65
arch/arm/src/lc823450/lc823450_i2c.c: Remove extra rounding after MSE…
jlaitine Jan 31, 2023
2e662df
arch/risc-v/src/mpfs/mpfs_ihc.c: Minor fixes
jpaali Jan 27, 2023
209536f
Remove MPFS_IHC_LINUX_ON_HART4 from default configurations
jpaali Jan 27, 2023
57ee2a0
arch/arm/src/stm32f7/stm32_ethernet.c: Fix "unused variable" warning
jlaitine Feb 3, 2023
eadc4fa
arch/risc-v/src/mpfs/mpfs_userspace.c: Map MTIME into userspace reser…
jlaitine Feb 9, 2023
19b23e1
boards/risc-v/mpfs/icicle: Add USRIO area for userspace IO mappings
jlaitine Feb 10, 2023
6f9d1f9
Add mpfs crypto driver into nuttx build
jlaitine Feb 13, 2023
50840af
mpfs/Kconfig: fix typo on config file
pussuw Feb 14, 2023
a0fea26
risc-v/mpfs: add athena irq defines
eenurkka Feb 14, 2023
b7da916
mpfs/mpfs_mm_init: Add the MTIME user mapping for kernel mode as well
pussuw Feb 14, 2023
1a6a106
arch/risc-v/src/mpfs/Kconfig: Fix sourcing crypto/Kconfig
jlaitine Feb 20, 2023
765bb98
Revert "arch/risc-v/src/mpfs/Kconfig: Fix sourcing crypto/Kconfig"
jlaitine Feb 23, 2023
8c6ecf3
arch/risc-v/src/mpfs/Kconfig: Don't source crypto/Kconfig
jlaitine Feb 23, 2023
3164886
DP-4881: The latest NuttX OpenAMP version does not work with Saluki H…
sthirvela Feb 22, 2023
21f75b9
clear spi int before the transfer starts
jnippula Feb 24, 2023
4230525
clear i2c ints before the transfer starts
jnippula Mar 1, 2023
b4e94fb
arch/risc-v/src/mpfs: symlink pf_crypto submodule
jnippula Mar 6, 2023
1c71686
Revert "Revert "rpmsg_socket: release tx buffer when send_oncopy fail…
jpaali Mar 9, 2023
4ad6d42
Revert "Revert "openamp: update openmap lib version to 2022.10.0""
jpaali Mar 9, 2023
2e57589
Revert "Revert "rptun: fix rptun don't wait issue when get tx patyload""
jpaali Mar 9, 2023
4bb7c69
Revert "Revert "openamp: don't depend on pen-amp.zip and libmetal.zip…
jpaali Mar 9, 2023
eb088b6
arch/riscv/src/mpfs/mpfs_ethernet.c: discard err rxframe in int work
jnippula Mar 9, 2023
52b3d8d
arch/risc-v/src/mpfs/crypto.defs: Update to include mpfs_systemservice.c
jlaitine Mar 16, 2023
add02c2
arch/risc-v/src/mpfs: Generate an unique locally administrated MAC ad…
jlaitine Apr 3, 2023
6ac72a7
risc-v/mpfs: emmcsd: enforce HS SDR mode properly
eenurkka Apr 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ jobs:
# Determine the repo and leave that unset to use the normal checkout behavior
# of using the merge commit instead of HEAD
case $GITHUB_REPOSITORY in
"apache/nuttx")
"tiiuae/nuttx")
# OS
echo "Triggered by change in OS"
APPS_REF=$REF_NAME
;;

"apache/nuttx-apps" )
"tiiuae/incubator-nuttx-apps" )
# APPS
OS_REF=$REF_NAME
echo "Triggered by change in APPS"
Expand All @@ -90,7 +90,7 @@ jobs:
- name: Checkout nuttx repo
uses: actions/checkout@v3
with:
repository: apache/nuttx
repository: tiiuae/nuttx
ref: ${{ steps.gittargets.outputs.os_ref }}
path: sources/nuttx
fetch-depth: 1
Expand All @@ -100,7 +100,7 @@ jobs:
- name: Checkout apps repo
uses: actions/checkout@v3
with:
repository: apache/nuttx-apps
repository: tiiuae/incubator-nuttx-apps
ref: ${{ steps.gittargets.outputs.apps_ref }}
path: sources/apps
fetch-depth: 1
Expand All @@ -122,7 +122,7 @@ jobs:

strategy:
matrix:
boards: [arm-01, arm-02, arm-03, arm-04, arm-05, arm-06, arm-07, arm-08, arm-09, arm-10, arm-11, arm-12, arm-13, other, risc-v, sim-01, sim-02, xtensa, codechecker]
boards: [arm-12, risc-v]

steps:
- name: Download Source Artifact
Expand Down Expand Up @@ -172,6 +172,7 @@ jobs:
continue-on-error: true

macOS:
if: ${{ false }} # disable for now
permissions:
contents: none
runs-on: macos-12
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Checkout nuttx repo
uses: actions/checkout@v3
with:
repository: apache/nuttx
repository: tiiuae/nuttx
path: nuttx
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/lc823450/lc823450_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ lc823450_i2c_sem_waitdone(struct lc823450_i2c_priv_s *priv)

/* Get the timeout value */

timeout = MSEC2TICK(priv->timeoms + (MSEC_PER_TICK / 2));
timeout = MSEC2TICK(priv->timeoms);
timeout += SEC2TICK(CONFIG_LC823450_I2C_TIMEOSEC);

/* Signal the interrupt handler that we are waiting. NOTE: Interrupts
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/src/stm32f7/stm32_ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3126,7 +3126,9 @@ static inline int stm32_dm9161(struct stm32_ethmac_s *priv)

static int stm32_phyinit(struct stm32_ethmac_s *priv)
{
#ifdef CONFIG_STM32F7_AUTONEG
volatile uint32_t timeout;
#endif
uint32_t regval;
uint16_t phyval;
int ret;
Expand Down
69 changes: 21 additions & 48 deletions arch/arm/src/stm32f7/stm32_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ struct stm32_i2c_config_s

struct stm32_i2c_priv_s
{
const struct i2c_ops_s *ops; /* Standard I2C operations */

/* Port configuration */

const struct stm32_i2c_config_s *config;
Expand Down Expand Up @@ -470,14 +472,6 @@ struct stm32_i2c_priv_s
#endif
};

/* I2C Device, Instance */

struct stm32_i2c_inst_s
{
const struct i2c_ops_s *ops; /* Standard I2C operations */
struct stm32_i2c_priv_s *priv; /* Common driver private data structure */
};

/****************************************************************************
* Private Function Prototypes
****************************************************************************/
Expand Down Expand Up @@ -533,6 +527,16 @@ static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
* Private Data
****************************************************************************/

/* Device Structures, Instantiation */

static const struct i2c_ops_s stm32_i2c_ops =
{
.transfer = stm32_i2c_transfer,
#ifdef CONFIG_I2C_RESET
.reset = stm32_i2c_reset,
#endif
};

#ifdef CONFIG_STM32F7_I2C1
static const struct stm32_i2c_config_s stm32_i2c1_config =
{
Expand All @@ -549,6 +553,7 @@ static const struct stm32_i2c_config_s stm32_i2c1_config =

static struct stm32_i2c_priv_s stm32_i2c1_priv =
{
.ops = &stm32_i2c_ops,
.config = &stm32_i2c1_config,
.refs = 0,
.lock = NXMUTEX_INITIALIZER,
Expand Down Expand Up @@ -585,6 +590,7 @@ static const struct stm32_i2c_config_s stm32_i2c2_config =

static struct stm32_i2c_priv_s stm32_i2c2_priv =
{
.ops = &stm32_i2c_ops,
.config = &stm32_i2c2_config,
.refs = 0,
.lock = NXMUTEX_INITIALIZER,
Expand Down Expand Up @@ -621,6 +627,7 @@ static const struct stm32_i2c_config_s stm32_i2c3_config =

static struct stm32_i2c_priv_s stm32_i2c3_priv =
{
.ops = &stm32_i2c_ops,
.config = &stm32_i2c3_config,
.refs = 0,
.lock = NXMUTEX_INITIALIZER,
Expand Down Expand Up @@ -657,6 +664,7 @@ static const struct stm32_i2c_config_s stm32_i2c4_config =

static struct stm32_i2c_priv_s stm32_i2c4_priv =
{
.ops = &stm32_i2c_ops,
.config = &stm32_i2c4_config,
.refs = 0,
.lock = NXMUTEX_INITIALIZER,
Expand All @@ -677,16 +685,6 @@ static struct stm32_i2c_priv_s stm32_i2c4_priv =
};
#endif

/* Device Structures, Instantiation */

static const struct i2c_ops_s stm32_i2c_ops =
{
.transfer = stm32_i2c_transfer,
#ifdef CONFIG_I2C_RESET
.reset = stm32_i2c_reset,
#endif
};

/****************************************************************************
* Private Functions
****************************************************************************/
Expand Down Expand Up @@ -2273,8 +2271,7 @@ static int stm32_i2c_deinit(struct stm32_i2c_priv_s *priv)
static int stm32_i2c_process(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count)
{
struct stm32_i2c_inst_s *inst = (struct stm32_i2c_inst_s *)dev;
struct stm32_i2c_priv_s *priv = inst->priv;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
uint32_t status = 0;
uint32_t cr1;
uint32_t cr2;
Expand Down Expand Up @@ -2505,15 +2502,11 @@ static int stm32_i2c_process(struct i2c_master_s *dev,
static int stm32_i2c_transfer(struct i2c_master_s *dev,
struct i2c_msg_s *msgs, int count)
{
struct stm32_i2c_priv_s *priv;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
int ret;

DEBUGASSERT(dev);

/* Get I2C private structure */

priv = ((struct stm32_i2c_inst_s *)dev)->priv;

/* Ensure that address or flags don't change meanwhile */

ret = nxmutex_lock(&priv->lock);
Expand All @@ -2536,7 +2529,7 @@ static int stm32_i2c_transfer(struct i2c_master_s *dev,
#ifdef CONFIG_I2C_RESET
static int stm32_i2c_reset(struct i2c_master_s *dev)
{
struct stm32_i2c_priv_s *priv;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;
unsigned int clock_count;
unsigned int stretch_count;
uint32_t scl_gpio;
Expand All @@ -2546,10 +2539,6 @@ static int stm32_i2c_reset(struct i2c_master_s *dev)

DEBUGASSERT(dev);

/* Get I2C private structure */

priv = ((struct stm32_i2c_inst_s *)dev)->priv;

/* Our caller must own a ref */

DEBUGASSERT(priv->refs > 0);
Expand Down Expand Up @@ -2748,7 +2737,6 @@ static int stm32_i2c_pm_prepare(struct pm_callback_s *cb, int domain,
struct i2c_master_s *stm32_i2cbus_initialize(int port)
{
struct stm32_i2c_priv_s *priv = NULL; /* private data of device with multiple instances */
struct stm32_i2c_inst_s *inst = NULL; /* device, single instance */

#if STM32_HSI_FREQUENCY != 16000000 || defined(INVALID_CLOCK_SOURCE)
# warning STM32_I2C_INIT: Peripheral clock is HSI and it must be 16mHz or the speed/timing calculations need to be redone.
Expand Down Expand Up @@ -2783,18 +2771,6 @@ struct i2c_master_s *stm32_i2cbus_initialize(int port)
return NULL;
}

/* Allocate instance */

if (!(inst = kmm_malloc(sizeof(struct stm32_i2c_inst_s))))
{
return NULL;
}

/* Initialize instance */

inst->ops = &stm32_i2c_ops;
inst->priv = priv;

/* Init private data for the first time, increment refs count,
* power-up hardware and configure GPIOs.
*/
Expand All @@ -2813,7 +2789,7 @@ struct i2c_master_s *stm32_i2cbus_initialize(int port)
}

nxmutex_unlock(&priv->lock);
return (struct i2c_master_s *)inst;
return (struct i2c_master_s *)priv;
}

/****************************************************************************
Expand All @@ -2826,10 +2802,9 @@ struct i2c_master_s *stm32_i2cbus_initialize(int port)

int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
{
struct stm32_i2c_priv_s *priv;
struct stm32_i2c_priv_s *priv = (struct stm32_i2c_priv_s *)dev;

DEBUGASSERT(dev);
priv = ((struct stm32_i2c_inst_s *)dev)->priv;

/* Decrement refs and check for underflow */

Expand All @@ -2842,7 +2817,6 @@ int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
if (--priv->refs)
{
nxmutex_unlock(&priv->lock);
kmm_free(dev);
return OK;
}

Expand All @@ -2857,7 +2831,6 @@ int stm32_i2cbus_uninitialize(struct i2c_master_s *dev)
stm32_i2c_deinit(priv);
nxmutex_unlock(&priv->lock);

kmm_free(dev);
return OK;
}

Expand Down
3 changes: 3 additions & 0 deletions arch/risc-v/include/mpfs/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@
#define MPFS_IRQ_WDOG2_TOUT (MPFS_IRQ_GLOBAL_START + 94)
#define MPFS_IRQ_WDOG3_TOUT (MPFS_IRQ_GLOBAL_START + 95)
#define MPFS_IRQ_WDOG4_TOUT (MPFS_IRQ_GLOBAL_START + 96)
#define MPFS_IRQ_ATHENA_COMPLETE (MPFS_IRQ_GLOBAL_START + 99)
#define MPFS_IRQ_ATHENA_ALARM (MPFS_IRQ_GLOBAL_START + 100)
#define MPFS_IRQ_ATHENA_BUS_ERROR (MPFS_IRQ_GLOBAL_START + 101)
#define MPFS_IRQ_FABRIC_F2H_0 (MPFS_IRQ_GLOBAL_START + 105)
#define MPFS_IRQ_FABRIC_F2H_1 (MPFS_IRQ_GLOBAL_START + 106)
#define MPFS_IRQ_FABRIC_F2H_2 (MPFS_IRQ_GLOBAL_START + 107)
Expand Down
1 change: 1 addition & 0 deletions arch/risc-v/src/mpfs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/crypto
Loading