Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
messigogogo committed Nov 10, 2023
1 parent 7331bf5 commit b87019e
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 39 deletions.
12 changes: 6 additions & 6 deletions bsp/phytium/aarch32/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

/* check if SMP related setting ok */
#ifndef RT_USING_SMP
ASSERT_STATIC(RT_CPUS_NR == 1U); /* please set RT_CPUS_NR = 1 when SMP off */
ASSERT_STATIC(RT_CPUS_NR == 1U); /* please set RT_CPUS_NR = 1 when SMP off */
#else
#if defined(TARGET_E2000D)
ASSERT_STATIC(RT_CPUS_NR <= 2U); /* use 2 cores at most */
#elif defined(TARGET_E2000Q) || defined(TARGET_PHYTIUMPI)
ASSERT_STATIC(RT_CPUS_NR <= 4U); /* use 4 cores at most */
#endif
#if defined(TARGET_E2000D)
ASSERT_STATIC(RT_CPUS_NR <= 2U); /* use 2 cores at most */
#elif defined(TARGET_E2000Q) || defined(TARGET_PHYTIUMPI)
ASSERT_STATIC(RT_CPUS_NR <= 4U); /* use 4 cores at most */
#endif
#endif

#ifdef RT_USING_SMP
Expand Down
12 changes: 9 additions & 3 deletions bsp/phytium/aarch32/applications/mnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ static int ram_disk_mount(const char *mount_point)

pool = rt_malloc(size);
if (pool == RT_NULL)
{
LOG_E("Malloc fail!");
}

if (dfs_mount(RT_NULL, mount_point, "ram", 0, (const void *)dfs_ramfs_create(pool, size)) == 0)
{
LOG_I("RAM file system initializated!");
}
else
{
LOG_E("RAM file system initializate failed!");
}
#endif

return RT_EOK;
Expand Down Expand Up @@ -72,7 +78,7 @@ static int sd_disk_try_mount(char *device_name, char *mount_point, char *fs_type
{
/* LOG_I("[%s]try mkfs -t %s %s ", mkfs_count, fs_type_name, device_name);
dfs_mkfs(fs_type_name, device_name); */
mkfs_count--;
mkfs_count--;
LOG_E("%s is not in %s, please format first !!!", device_name, fs_type_name);
goto _remount;
}
Expand Down Expand Up @@ -107,9 +113,9 @@ static void sd_filesytem_task_entry(void *parameter)
int filesystem_mount(void)
{
rt_thread_t tid;
tid = rt_thread_create("sd_filesytem", sd_filesytem_task_entry,
tid = rt_thread_create("sd_filesytem", sd_filesytem_task_entry,
RT_NULL,
4096,
4096,
RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{
Expand Down
12 changes: 6 additions & 6 deletions bsp/phytium/aarch64/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

/* check if SMP related setting ok */
#ifndef RT_USING_SMP
ASSERT_STATIC(RT_CPUS_NR == 1U); /* please set RT_CPUS_NR = 1 when SMP off */
ASSERT_STATIC(RT_CPUS_NR == 1U); /* please set RT_CPUS_NR = 1 when SMP off */
#else
#if defined(TARGET_E2000D)
ASSERT_STATIC(RT_CPUS_NR <= 2U); /* use 2 cores at most */
#elif defined(TARGET_E2000Q) || defined(TARGET_PHYTIUMPI)
ASSERT_STATIC(RT_CPUS_NR <= 4U); /* use 4 cores at most */
#endif
#if defined(TARGET_E2000D)
ASSERT_STATIC(RT_CPUS_NR <= 2U); /* use 2 cores at most */
#elif defined(TARGET_E2000Q) || defined(TARGET_PHYTIUMPI)
ASSERT_STATIC(RT_CPUS_NR <= 4U); /* use 4 cores at most */
#endif
#endif

#ifdef RT_USING_SMP
Expand Down
12 changes: 9 additions & 3 deletions bsp/phytium/aarch64/applications/mnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ static int ram_disk_mount(const char *mount_point)

pool = rt_malloc(size);
if (pool == RT_NULL)
{
LOG_E("Malloc fail!");
}

err = dfs_mount(RT_NULL, mount_point, "ram", 0, (const void *)dfs_ramfs_create(pool, size));
if (err == RT_EOK)
{
LOG_I("RAM file system initializated!");
}
else
{
LOG_E("RAM file system initializate failed!, err = %d", err);
}
#endif

return RT_EOK;
Expand Down Expand Up @@ -74,7 +80,7 @@ static int sd_disk_try_mount(char *device_name, char *mount_point, char *fs_type
{
/* LOG_I("[%s]try mkfs -t %s %s ", mkfs_count, fs_type_name, device_name);
dfs_mkfs(fs_type_name, device_name); */
mkfs_count--;
mkfs_count--;
LOG_E("%s is not in %s, please format first !!!", device_name, fs_type_name);
goto _remount;
}
Expand Down Expand Up @@ -109,9 +115,9 @@ static void sd_filesytem_task_entry(void *parameter)
int filesystem_mount(void)
{
rt_thread_t tid;
tid = rt_thread_create("sd_filesytem", sd_filesytem_task_entry,
tid = rt_thread_create("sd_filesytem", sd_filesytem_task_entry,
RT_NULL,
4096,
4096,
RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{
Expand Down
34 changes: 17 additions & 17 deletions bsp/phytium/libraries/drivers/drv_sdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <drivers/mmcsd_core.h>

#ifdef RT_USING_SMART
#include "ioremap.h"
#include "ioremap.h"
#endif
#include "mm_aspace.h"
#include "interrupt.h"
Expand Down Expand Up @@ -142,13 +142,13 @@ static void fsdif_ctrl_setup_interrupt(struct rt_mmcsd_host *host)
NULL);

/* enable irq */
rt_hw_interrupt_umask(config_p->irq_num);
rt_hw_interrupt_umask(config_p->irq_num);

FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_CARD_DETECTED, fsdif_card_detect_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_ERR_OCCURE, fsdif_error_occur_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_CMD_DONE, fsdif_command_done_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_DATA_DONE, fsdif_data_done_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_SDIO_IRQ, fsdif_sdio_irq_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_CARD_DETECTED, fsdif_card_detect_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_ERR_OCCURE, fsdif_error_occur_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_CMD_DONE, fsdif_command_done_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_DATA_DONE, fsdif_data_done_callback, host);
FSdifRegisterEvtHandler(mmcsd_instance, FSDIF_EVT_SDIO_IRQ, fsdif_sdio_irq_callback, host);

return;
}
Expand Down Expand Up @@ -240,22 +240,22 @@ rt_inline rt_err_t fsdif_dma_transfer(struct rt_mmcsd_host *host, struct rt_mmcs

while (TRUE)
{
if (rt_event_recv(&private_data->event,
(wait_event),
(RT_EVENT_FLAG_AND | RT_EVENT_FLAG_CLEAR | RT_WAITING_NO),
rt_tick_from_millisecond(5000),
&event) == RT_EOK)
if (rt_event_recv(&private_data->event,
(wait_event),
(RT_EVENT_FLAG_AND | RT_EVENT_FLAG_CLEAR | RT_WAITING_NO),
rt_tick_from_millisecond(5000),
&event) == RT_EOK)
{
(void)FSdifGetCmdResponse(mmcsd_instance, req_cmd);
break;
}
else
{
if (rt_event_recv(&private_data->event,
(SDIF_EVENT_ERROR_OCCUR),
(RT_EVENT_FLAG_CLEAR | RT_WAITING_NO),
rt_tick_from_millisecond(5000),
&event) == RT_EOK)
if (rt_event_recv(&private_data->event,
(SDIF_EVENT_ERROR_OCCUR),
(RT_EVENT_FLAG_CLEAR | RT_WAITING_NO),
rt_tick_from_millisecond(5000),
&event) == RT_EOK)
{
LOG_E("Sdif DMA transfer endup with error !!!");
return -RT_EIO;
Expand Down
4 changes: 2 additions & 2 deletions bsp/phytium/libraries/port/fdriver_port/fdrivers_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

#include "ftypes.h"
#ifdef __aarch64__
#include "faarch64.h"
#include "faarch64.h"
#else
#include "faarch32.h"
#include "faarch32.h"
#endif
#include <rtthread.h>
#include <rtdbg.h>
Expand Down
5 changes: 3 additions & 2 deletions bsp/phytium/libraries/standalone/drivers/mmc/fsdif/fsdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ FError FSdifResetCtrl(uintptr base_addr, u32 reset_bits)
do
{
reg_val = FSDIF_READ_REG(base_addr, FSDIF_STATUS_OFFSET);
} while (!(FSDIF_STATUS_FIFO_EMPTY & reg_val));

}
while (!(FSDIF_STATUS_FIFO_EMPTY & reg_val));

if (retries <= 0)
{
FSDIF_ERROR("Fifo not empty !!!");
Expand Down

0 comments on commit b87019e

Please sign in to comment.