risc-v/bl602: add boardctl support

Signed-off-by: Virus.V <virusv@live.com>
Change-Id: I74280f5cb801e923fb987009ae007aa02677b14d
This commit is contained in:
Virus.V 2021-07-13 16:20:07 +08:00 committed by Xiang Xiao
parent 48f2b10ee3
commit 4e950c3e30

View File

@ -28,11 +28,13 @@
#include <stdio.h>
#include <syslog.h>
#include <errno.h>
#include <assert.h>
#include <nuttx/board.h>
#include "chip.h"
#include "bl602evb.h"
#include "bl602_efuse.h"
/****************************************************************************
* Public Functions
@ -67,3 +69,30 @@ int board_app_initialize(uintptr_t arg)
return 0;
}
#ifdef CONFIG_BOARDCTL_IOCTL
int board_ioctl(unsigned int cmd, uintptr_t arg)
{
switch (cmd)
{
default:
return -EINVAL;
}
return OK;
}
#endif
#if defined(CONFIG_BOARDCTL_UNIQUEID)
int board_uniqueid(uint8_t *uniqueid)
{
DEBUGASSERT(CONFIG_BOARDCTL_UNIQUEID_SIZE >= 6);
if (uniqueid == NULL)
{
return -EINVAL;
}
bl602_efuse_read_mac_address(uniqueid);
return OK;
}
#endif