Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion build/configs/bk7239n/hello/defconfig
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ CONFIG_PHY_PWD=y
CONFIG_SOFT_CTRL_VOLT=y
# CONFIG_KEEP_VDDDIG_VOLT_IN_LV is not set
# CONFIG_NORMAL_SLEEP_ULTRA_LOW_POWER is not set
# CONFIG_MAC_USE_RTC is not set

#
# VAULT
Expand Down Expand Up @@ -910,7 +911,7 @@ CONFIG_BLE=y
# CONFIG_BLUETOOTH_BLE_DISCOVER_AUTO is not set
CONFIG_SUPPORT_BLE_ADV_TXPWR_SET=y
CONFIG_SUPPORT_BLE_RECONNECTION_STRATEGY=y
# CONFIG_SUPPORT_REPORTING_COEX_BLE_STATE is not set
CONFIG_SUPPORT_REPORTING_COEX_BLE_STATE=y

#
# PSA Mbedtls
Expand Down
6 changes: 4 additions & 2 deletions build/configs/bk7239n/loadable_apps/defconfig
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ CONFIG_PHY_PWD=y
CONFIG_SOFT_CTRL_VOLT=y
# CONFIG_KEEP_VDDDIG_VOLT_IN_LV is not set
# CONFIG_NORMAL_SLEEP_ULTRA_LOW_POWER is not set
# CONFIG_MAC_USE_RTC is not set

#
# VAULT
Expand Down Expand Up @@ -920,7 +921,7 @@ CONFIG_BLE=y
# CONFIG_BLUETOOTH_BLE_DISCOVER_AUTO is not set
CONFIG_SUPPORT_BLE_ADV_TXPWR_SET=y
CONFIG_SUPPORT_BLE_RECONNECTION_STRATEGY=y
# CONFIG_SUPPORT_REPORTING_COEX_BLE_STATE is not set
CONFIG_SUPPORT_REPORTING_COEX_BLE_STATE=y

#
# PSA Mbedtls
Expand Down Expand Up @@ -1035,7 +1036,7 @@ CONFIG_ARCH_BOARD_HAVE_FLASH=y
#
CONFIG_FLASH_PARTITION=y
CONFIG_FLASH_MINOR=0
CONFIG_FLASH_PART_SIZE="92,76,8,8,456,1496,1496,384,384,128,128,512,100,8,11068,4,4,24,8,"
CONFIG_FLASH_PART_SIZE="92,76,8,8,456,1624,1624,384,384,128,128,512,100,8,10812,4,4,24,8,"
CONFIG_FLASH_PART_TYPE="none,none,none,none,none,kernel,kernel,bin,bin,bin,bin,smartfs,none,none,none,none,none,none,bootparam,"
CONFIG_FLASH_PART_NAME="bl1,bl2,sys_its,sys_ps,ss,kernel,kernel,app1,app1,app2,app2,userfs,usrconfig,system_data,reserved,rf,net,easyflash,bootparam,"
# CONFIG_ARCH_BOARD_HAVE_SECOND_FLASH is not set
Expand Down Expand Up @@ -1541,6 +1542,7 @@ CONFIG_NET_STATS=y
# CONFIG_NET_IPv6_ICMP_STATS is not set
# CONFIG_NET_IPv6_MLD_STATS is not set
# CONFIG_NET_IPv6_ND_STATS is not set
# CONFIG_NET_LWIP_HW_CHKSUM_PORT is not set
# CONFIG_NET_LWIP_VLAN is not set
# CONFIG_NET_LWIP_SLIP_INTERFACE is not set
# CONFIG_NET_LWIP_PPP_SUPPORT is not set
Expand Down
7 changes: 4 additions & 3 deletions build/configs/bk7239n/loadable_apps_iperf/defconfig
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ CONFIG_PHY_PWD=y
CONFIG_SOFT_CTRL_VOLT=y
# CONFIG_KEEP_VDDDIG_VOLT_IN_LV is not set
# CONFIG_NORMAL_SLEEP_ULTRA_LOW_POWER is not set
# CONFIG_MAC_USE_RTC is not set

#
# VAULT
Expand Down Expand Up @@ -920,7 +921,7 @@ CONFIG_BLE=y
# CONFIG_BLUETOOTH_BLE_DISCOVER_AUTO is not set
CONFIG_SUPPORT_BLE_ADV_TXPWR_SET=y
CONFIG_SUPPORT_BLE_RECONNECTION_STRATEGY=y
# CONFIG_SUPPORT_REPORTING_COEX_BLE_STATE is not set
CONFIG_SUPPORT_REPORTING_COEX_BLE_STATE=y

#
# PSA Mbedtls
Expand Down Expand Up @@ -1228,8 +1229,7 @@ CONFIG_SPI_CMDDATA=y
CONFIG_BCH=y
CONFIG_RTC=y
# CONFIG_RTC_DATETIME is not set
CONFIG_RTC_HIRES=y
CONFIG_RTC_FREQUENCY=32000
# CONFIG_RTC_HIRES is not set
CONFIG_RTC_ALARM=y
CONFIG_RTC_DRIVER=y
CONFIG_RTC_IOCTL=y
Expand Down Expand Up @@ -1542,6 +1542,7 @@ CONFIG_NET_STATS=y
# CONFIG_NET_IPv6_ICMP_STATS is not set
# CONFIG_NET_IPv6_MLD_STATS is not set
# CONFIG_NET_IPv6_ND_STATS is not set
CONFIG_NET_LWIP_HW_CHKSUM_PORT=y
# CONFIG_NET_LWIP_VLAN is not set
# CONFIG_NET_LWIP_SLIP_INTERFACE is not set
# CONFIG_NET_LWIP_PPP_SUPPORT is not set
Expand Down
245 changes: 81 additions & 164 deletions build/configs/bk7239n/scripts/bk7239n_bsp.ld
100755 → 100644

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions build/configs/bk7239n/scripts/bk7239n_bsp_ns.ld
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")

__MSP_STACK_SIZE = CONFIG_IDLETHREAD_STACKSIZE;
__CPU0_SPE_RAM_SIZE = CONFIG_CPU0_SPE_RAM_SIZE;
__MIN_HEAP_SIZE = (90 << 10);
__MIN_HEAP_SIZE = (85 << 10);
PERSIST_MEM_AREA_SIZE = 4;
REBOOT_TAG_AREA_SIZE = 4;
__CPU0_APP_RAM_BASE = 0x38000000 + __CPU0_SPE_RAM_SIZE;
Expand Down Expand Up @@ -108,6 +108,13 @@ SECTIONS
*libboard.a:rxl_cntrl.o*
*rf_cntrl.o*
*co_list.o*
*libnet.a:tcp_in.o*
*libnet.a:tcp_out.o*
*libnet.a:tcp.o*
*libnet.a:ip4.o*
*libnet.a:ip.o*
*libnet.a:netif.o*
*libnet.a:pbuf.o*
) *(.text .text.* .rodata .rodata.*)
/**(.text.* *.rodata *.rodata.*)*/

Expand Down Expand Up @@ -235,6 +242,13 @@ SECTIONS
*libboard.a:rxl_cntrl.o* (.text .text.* .rodata .rodata.*)
*rf_cntrl.o* (.text .text.* .rodata .rodata.*)
*co_list.o* (.text .text.* .rodata .rodata.*)
*libnet.a:tcp_in.o* (.text .text.* .rodata .rodata.*)
*libnet.a:tcp_out.o* (.text .text.* .rodata .rodata.*)
*libnet.a:tcp.o* (.text .text.* .rodata .rodata.*)
*libnet.a:ip4.o* (.text .text.* .rodata .rodata.*)
*libnet.a:ip.o* (.text .text.* .rodata .rodata.*)
*libnet.a:netif.o* (.text .text.* .rodata .rodata.*)
*libnet.a:pbuf.o* (.text .text.* .rodata .rodata.*)
*(.itcm)
*(.itcm_sec_code)
*(.iram)
Expand Down Expand Up @@ -391,5 +405,5 @@ SECTIONS

ASSERT((s_rom_end < ORIGIN(FLASH) + LENGTH(FLASH)), "ROM overflow!!!")
ASSERT(((ORIGIN(RAM) + LENGTH(RAM)) > (_heap_start + __MSP_STACK_SIZE + 8)), "Stack overflowed with bss")
ASSERT(((_heap_end - _heap_start) >= __MIN_HEAP_SIZE), "Heap smaller than minimize size 90K!!!")
ASSERT(((_heap_end - _heap_start) >= __MIN_HEAP_SIZE), "Heap smaller than minimize size 85K!!!")
}
6 changes: 3 additions & 3 deletions build/tools/armino/bkfil_pack_tool/bkfil_bin_pack.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _get_parser(self) -> PartitionsParser:
parser = PartitionsParser(self.config)
required = ["kernel", "bootparam"]
optional = ["app1", "app2", "userfs"]
if self.config.get("CONFIG_BINARY_SIGNING", "n") != "y":
if self.config.get("CONFIG_TFM", "n") != "y":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ziliguo : Please explain what is effect of this change ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @amandeep-samsung ,
Before this modification was added, the bootloader was packaged within all-app.bin. After this modification, the bootloader can be separated from all-app.bin. This allows all-app.bin to be downloaded via the bootloader, and the bootloader includes optimizations for download speed.

required += ["bl1"]
parser.set_required(required)
parser.set_optional(optional)
Expand All @@ -68,8 +68,8 @@ def pack(self):
fs_bin = self.workdir / self.fs_bin_name
if not fs_bin.exists():
parser.create_dummy_fs_bin(fs_bin)
packager = bk_packager_format(self.workdir, pack_json)
if self.config.get("CONFIG_TFM", "n") == "y" and self.config.get("CONFIG_BINARY_SIGNING", "n") == "y":
packager = bk_packager_format(self.workdir, pack_json, Path("all-app.bin"))
if self.config.get("CONFIG_TFM", "n") == "y":
packager.set_magic_header(b'BKDLV10.')
packager.pack()

Expand Down
2 changes: 1 addition & 1 deletion build/tools/armino/tfm_prehandle/scripts/partition.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def parse_and_validate_partition_size(self):
if self.is_secondary:
if (self.partition_size != self.primary_partition.partition_size):
logging.error(f'Size of {self.partition_name} and {self.primary_partition.partition_name} not equal')
#exit(1) // BEKEN WORKAROUND TODO:The flash size limit causes different sizes of primary and second partitions
exit(1)

logging.debug(f'partition{self.idx} {self.partition_name} partition size=%x' %(self.partition_size))

Expand Down
56 changes: 39 additions & 17 deletions os/arch/arm/src/armino/armino_idle.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,27 @@
#include "chip.h"
#include "up_internal.h"
#include <driver/uart.h>
#include <stdbool.h>


/*=====================DEFINE SECTION START====================*/
typedef int bk_err_t; /**< Return error code */
#define MAX_REASONABLE_TICKS 86400000ULL /* 24 hours in ticks (1ms per tick) */

typedef int bk_err_t; /**< Return error code */
#define MAX_REASONABLE_TICKS 86400000ULL /* 24 hours in ticks (1ms per tick) */
#define DOMAIN_NAME_SUSPEND_TEST "SUSPEND_TEST"
#define PM_DEFAULT_SLEEP_TIME_US (100000) //100ms
/*=====================DEFINE SECTION END======================*/


/*=====================VARIABLE SECTION START==================*/
clock_t s_missed_ticks = 0;

extern sq_queue_t g_wdactivelist;
/*=====================VARIABLE SECTION END====================*/

/*================FUNCTION DECLARATION SECTION START===========*/
extern void up_set_pm_timer(unsigned int interval_us);
extern void up_set_dvfs(int div_lvl);
extern uint32_t pm_get_sleep_time(void);
extern struct pm_domain_s *pm_domain_find(FAR const char *domain_name);
int armino_sleep_processing(void);
//extern uint64_t bk_pm_suppress_ticks_and_sleep(uint32_t sleep_ticks);

Expand All @@ -100,7 +104,26 @@ static clock_t up_get_missed_ticks(void)
{
return s_missed_ticks;
}
static bool up_check_valid_wakeup()
{
/* Check watchdog active list to see if there is any wakeup timer with lag > 0 */
bool has_valid_wakeup = false;
struct wdog_s *curr = NULL;

for (curr = (FAR struct wdog_s *)g_wdactivelist.head; curr; curr = curr->next) {
if (WDOG_ISWAKEUP(curr)) {
has_valid_wakeup = true;
break;
}
}

/* Check whether it set sleep time for registered domain*/
struct pm_domain_s * domain = pm_domain_find(DOMAIN_NAME_SUSPEND_TEST);
if((has_valid_wakeup == false)&& (domain != NULL)) {
return 0;
}
return 1;
}
/****************************************************************************
* Name: up_pm_board_sleep
*
Expand All @@ -119,23 +142,23 @@ static int up_pm_board_sleep()
if (!g_pmglobals.is_running) {
return 0;
}

if(up_check_valid_wakeup() == 0) {
return 0;
}
if(pm_checkstate() == PM_SLEEP)
{
#if CONFIG_PM_LOWEST_POWER_MODE == 0
bk_pm_sleep_mode_set(PM_MODE_NORMAL_SLEEP);
#elif CONFIG_PM_LOWEST_POWER_MODE == 1
bk_pm_sleep_mode_set(PM_MODE_LOW_VOLTAGE);
#elif CONFIG_PM_LOWEST_POWER_MODE == 2
bk_pm_sleep_mode_set(PM_MODE_DEEP_SLEEP);
#elif CONFIG_PM_LOWEST_POWER_MODE == 3
bk_pm_sleep_mode_set(PM_MODE_SUPER_DEEP_SLEEP);
#endif
bk_pm_module_vote_sleep_ctrl(PM_SLEEP_MODULE_NAME_APP,0x1,0x0);
struct wdog_s *curr = NULL;

for (curr = (FAR struct wdog_s *)g_wdactivelist.head; curr; curr = curr->next) {
if ((WDOG_ISWAKEUP(curr)) && (curr->lag <= CONFIG_PM_SLEEP_ENTRY_WAIT_MS)) {
up_set_pm_timer(PM_DEFAULT_SLEEP_TIME_US);
break;
}
}
}
else
{
bk_pm_module_vote_sleep_ctrl(PM_SLEEP_MODULE_NAME_APP,0x0,0x0);
//bk_pm_module_vote_sleep_ctrl(PM_SLEEP_MODULE_NAME_APP,0x0,0x0);
}

return 0;
Expand Down Expand Up @@ -295,6 +318,5 @@ int armino_sleep_processing()
bk_rtc_get_first_alarm_name());
}
#endif

return 0;
}
29 changes: 29 additions & 0 deletions os/arch/arm/src/armino/armino_pmhelpers.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
#ifdef CONFIG_PM
#include <tinyara/pm/pm.h>

static uint32_t s_pm_timer_interval_us = 0;

uint32_t pm_get_sleep_time(void)
{
return s_pm_timer_interval_us;
}
static void pm_timer_wakeup_callback(aon_rtc_id_t id, uint8_t *name_p, void *param)
{
pm_ap_core_msg_t msg = {0};
Expand All @@ -63,6 +69,11 @@ static void pm_timer_wakeup_callback(aon_rtc_id_t id, uint8_t *name_p, void *par
}
void up_set_pm_timer(unsigned int interval_us)
{
volatile uint32_t int_level = 0;
int_level = pm_disable_int();

s_pm_timer_interval_us = interval_us;

#if defined(CONFIG_AON_RTC) || defined(CONFIG_ANA_RTC)
uint32_t sleep_count = 1; //one count
alarm_info_t sleep_alarm = {0};
Expand All @@ -78,6 +89,24 @@ void up_set_pm_timer(unsigned int interval_us)
bk_alarm_unregister(AON_RTC_ID_1, sleep_alarm.name);
bk_alarm_register(AON_RTC_ID_1, &sleep_alarm);
#endif //CONFIG_AON_RTC

#if CONFIG_PM_LOWEST_POWER_MODE == 0
bk_pm_sleep_mode_set(PM_MODE_NORMAL_SLEEP);
bk_pm_module_vote_sleep_ctrl(PM_SLEEP_MODULE_NAME_APP,0x1,0x0);
#elif CONFIG_PM_LOWEST_POWER_MODE == 1
bk_pm_sleep_mode_set(PM_MODE_LOW_VOLTAGE);
bk_pm_module_vote_sleep_ctrl(PM_SLEEP_MODULE_NAME_APP,0x1,0x0);
// #elif CONFIG_PM_LOWEST_POWER_MODE == 2
// bk_pm_sleep_mode_set(PM_MODE_DEEP_SLEEP);
// bk_pm_module_vote_sleep_ctrl(PM_SLEEP_MODULE_NAME_APP,0x1,0x0);
// #elif CONFIG_PM_LOWEST_POWER_MODE == 3
// bk_pm_sleep_mode_set(PM_MODE_SUPER_DEEP_SLEEP);
// bk_pm_module_vote_sleep_ctrl(PM_SLEEP_MODULE_NAME_APP,0x1,0x0);
#else
bk_pm_sleep_mode_set(PM_MODE_DEFAULT);
bk_pm_module_vote_sleep_ctrl(PM_SLEEP_MODULE_NAME_APP,0x0,0x0);
#endif
pm_enable_int(int_level);
}

void bsp_pm_domain_register(char *domain_name, int bsp_drv_id)
Expand Down
Loading