Skip to content

Commit

Permalink
Merge branch 'bugfix/update_esp_rom_layout' into 'master'
Browse files Browse the repository at this point in the history
esp_rom: fix rom layout issues

See merge request espressif/esp-idf!23888
  • Loading branch information
jack0c committed Jun 16, 2023
2 parents 28c643a + 0d0fa7b commit 3a45d4e
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 54 deletions.
30 changes: 28 additions & 2 deletions components/esp_rom/include/esp32c2/rom/rom_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ extern "C" {
#endif

#define SUPPORT_BTDM 1
#define SUPPORT_BTBB 1
#define SUPPORT_WIFI 1
#define SUPPORT_USB_DWCOTG 0
#define SUPPORT_COEXIST 1
#define SUPPORT_MBEDTLS 1

/* Structure and functions for returning ROM global layout
*
Expand All @@ -28,6 +32,7 @@ typedef struct {
void *stack_app;

/* BTDM data */
#if SUPPORT_BTDM
void *data_start_btdm;
void *data_end_btdm;
void *bss_start_btdm;
Expand All @@ -38,12 +43,19 @@ typedef struct {
void *data_end_interface_btdm;
void *bss_start_interface_btdm;
void *bss_end_interface_btdm;
#endif

#if SUPPORT_BTBB
void *dram_start_btbbrom;
void *dram_end_btbbrom;
#endif

/* Other DRAM ranges */
#if SUPPORT_BTDM || SUPPORT_WIFI
void *dram_start_phyrom;
void *dram_end_phyrom;
#endif

#if SUPPORT_WIFI
void *dram_start_coexist;
void *dram_end_coexist;
Expand All @@ -64,11 +76,25 @@ typedef struct {
void *bss_start_interface_pp;
void *bss_end_interface_pp;
#endif
void *dram_start_usbdev_rom;
void *dram_end_usbdev_rom;

#if SUPPORT_USB_DWCOTG
void *dram_start_usb_dwcotg_rom;
void *dram_end_usb_dwcotg_rom;
#else
//Two reserved members are defined here, so the structure will not be broken,
//please keep in mind that there is no memory can be released between
//dram_start_usb_reserved_rom ~ dram_end_usb_reserved_rom.
void *dram_start_usb_reserved_rom;
void *dram_end_usb_reserved_rom;
#endif

void *dram_start_uart_rom;
void *dram_end_uart_rom;

#if SUPPORT_MBEDTLS
void *dram_start_mbedtls_rom;
void *dram_end_mbedtls_rom;
#endif
} ets_rom_layout_t;

extern const ets_rom_layout_t * const ets_rom_layout_p;
Expand Down
37 changes: 21 additions & 16 deletions components/esp_rom/include/esp32c3/rom/rom_layout.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

Expand All @@ -22,6 +14,7 @@ extern "C" {

#define SUPPORT_BTDM 1
#define SUPPORT_WIFI 1
#define SUPPORT_USB_DWCOTG 0

/* Structure and functions for returning ROM global layout
*
Expand All @@ -36,6 +29,7 @@ typedef struct {
void *stack_app;

/* BTDM data */
#if SUPPORT_BTDM
void *data_start_btdm;
void *data_end_btdm;
void *bss_start_btdm;
Expand All @@ -46,12 +40,14 @@ typedef struct {
void *data_end_interface_btdm;
void *bss_start_interface_btdm;
void *bss_end_interface_btdm;
#endif

/* Other DRAM ranges */
#if SUPPORT_BTDM || SUPPORT_WIFI
void *dram_start_phyrom;
void *dram_end_phyrom;
#endif

#if SUPPORT_WIFI
void *dram_start_coexist;
void *dram_end_coexist;
Expand All @@ -72,11 +68,20 @@ typedef struct {
void *bss_start_interface_pp;
void *bss_end_interface_pp;
#endif
void *dram_start_usbdev_rom;
void *dram_end_usbdev_rom;

#if SUPPORT_USB_DWCOTG
void *dram_start_usb_dwcotg_rom;
void *dram_end_usb_dwcotg_rom;
#else
//Two reserved members are defined here, so the structure will not be broken,
//please keep in mind that there is no memory can be released between
//dram_start_usb_reserved_rom ~ dram_end_usb_reserved_rom.
void *dram_start_usb_reserved_rom;
void *dram_end_usb_reserved_rom;
#endif

void *dram_start_uart_rom;
void *dram_end_uart_rom;

} ets_rom_layout_t;

extern const ets_rom_layout_t * const ets_rom_layout_p;
Expand Down
21 changes: 14 additions & 7 deletions components/esp_rom/include/esp32c6/rom/rom_layout.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -12,11 +12,12 @@
extern "C" {
#endif

#define SUPPORT_BTDM 1
#define SUPPORT_BTBB 1
#define SUPPORT_BTDM 0
#define SUPPORT_BTBB 0
#define SUPPORT_WIFI 1
#define SUPPORT_USB_DEVICE 1
#define SUPPORT_USB_DWCOTG 0
#define SUPPORT_COEXIST 1
#define SUPPORT_MBEDTLS 0

/* Structure and functions for returning ROM global layout
*
Expand Down Expand Up @@ -79,9 +80,15 @@ typedef struct {
void *dram_end_mbedtls_rom;
#endif

#if SUPPORT_USB_DEVICE
void *dram_start_usbdev_rom;
void *dram_end_usbdev_rom;
#if SUPPORT_USB_DWCOTG
void *dram_start_usb_dwcotg_rom;
void *dram_end_usb_dwcotg_rom;
#else
//Two reserved members are defined here, so the structure will not be broken,
//please keep in mind that there is no memory can be released between
//dram_start_usb_reserved_rom ~ dram_end_usb_reserved_rom.
void *dram_start_usb_reserved_rom;
void *dram_end_usb_reserved_rom;
#endif

void *dram_start_uart_rom;
Expand Down
35 changes: 26 additions & 9 deletions components/esp_rom/include/esp32h2/rom/rom_layout.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -12,8 +12,12 @@
extern "C" {
#endif

#define SUPPORT_BTDM 1
#define SUPPORT_WIFI 1
#define SUPPORT_BTDM 0
#define SUPPORT_BTBB 0
#define SUPPORT_WIFI 0
#define SUPPORT_USB_DWCOTG 0
#define SUPPORT_COEXIST 0
#define SUPPORT_MBEDTLS 0

/* Structure and functions for returning ROM global layout
*
Expand All @@ -24,10 +28,8 @@ typedef struct {
void *dram0_rtos_reserved_start;
void *stack_sentry;
void *stack;
void *stack_sentry_app;
void *stack_app;

/* BTDM data */
#if SUPPORT_BTDM
void *data_start_btdm;
void *data_end_btdm;
void *bss_start_btdm;
Expand All @@ -38,6 +40,12 @@ typedef struct {
void *data_end_interface_btdm;
void *bss_start_interface_btdm;
void *bss_end_interface_btdm;
#endif

#if SUPPORT_BTBB
void *dram_start_btbbrom;
void *dram_end_btbbrom;
#endif

/* Other DRAM ranges */
#if SUPPORT_BTDM || SUPPORT_WIFI
Expand All @@ -64,11 +72,20 @@ typedef struct {
void *bss_start_interface_pp;
void *bss_end_interface_pp;
#endif
void *dram_start_usbdev_rom;
void *dram_end_usbdev_rom;

#if SUPPORT_USB_DWCOTG
void *dram_start_usb_dwcotg_rom;
void *dram_end_usb_dwcotg_rom;
#else
//Two reserved members are defined here, so the structure will not be broken,
//please keep in mind that there is no memory can be released between
//dram_start_usb_reserved_rom ~ dram_end_usb_reserved_rom.
void *dram_start_usb_reserved_rom;
void *dram_end_usb_reserved_rom;
#endif

void *dram_start_uart_rom;
void *dram_end_uart_rom;

} ets_rom_layout_t;

extern const ets_rom_layout_t * const ets_rom_layout_p;
Expand Down
42 changes: 24 additions & 18 deletions components/esp_rom/include/esp32s3/rom/rom_layout.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once
#include <stdint.h>
Expand All @@ -19,8 +11,10 @@
extern "C" {
#endif

#define SUPPORT_WIFI 1
#define SUPPORT_BTDM 1
#define SUPPORT_WIFI 1
#define SUPPORT_BTDM 1
#define SUPPORT_USB_DWCOTG 1

/* Structure and functions for returning ROM global layout
*
* This is for address symbols defined in the linker script, which may change during ECOs.
Expand All @@ -34,6 +28,7 @@ typedef struct {
void *stack_app;

/* BTDM data */
#if SUPPORT_BTDM
void *data_start_btdm;
void *data_end_btdm;
void *bss_start_btdm;
Expand All @@ -44,12 +39,14 @@ typedef struct {
void *data_end_interface_btdm;
void *bss_start_interface_btdm;
void *bss_end_interface_btdm;
#endif

/* Other DRAM ranges */
#if SUPPORT_BTDM || SUPPORT_WIFI
void *dram_start_phyrom;
void *dram_end_phyrom;
#endif

#if SUPPORT_WIFI
void *dram_start_coexist;
void *dram_end_coexist;
Expand All @@ -70,11 +67,20 @@ typedef struct {
void *bss_start_interface_pp;
void *bss_end_interface_pp;
#endif
void *dram_start_usbdev_rom;
void *dram_end_usbdev_rom;

#if SUPPORT_USB_DWCOTG
void *dram_start_usb_dwcotg_rom;
void *dram_end_usb_dwcotg_rom;
#else
//Two reserved members are defined here, so the structure will not be broken,
//please keep in mind that there is no memory can be released between
//dram_start_usb_reserved_rom ~ dram_end_usb_reserved_rom.
void *dram_start_usb_reserved_rom;
void *dram_end_usb_reserved_rom;
#endif

void *dram_start_uart_rom;
void *dram_end_uart_rom;

} ets_rom_layout_t;

extern const ets_rom_layout_t * const ets_rom_layout_p;
Expand Down
2 changes: 0 additions & 2 deletions tools/ci/check_copyright_ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ components/esp_rom/include/esp32c3/rom/crc.h
components/esp_rom/include/esp32c3/rom/digital_signature.h
components/esp_rom/include/esp32c3/rom/esp_flash.h
components/esp_rom/include/esp32c3/rom/hmac.h
components/esp_rom/include/esp32c3/rom/rom_layout.h
components/esp_rom/include/esp32c3/rom/rsa_pss.h
components/esp_rom/include/esp32c3/rom/sha.h
components/esp_rom/include/esp32c3/rom/tjpgd.h
Expand All @@ -504,7 +503,6 @@ components/esp_rom/include/esp32s3/rom/crc.h
components/esp_rom/include/esp32s3/rom/digital_signature.h
components/esp_rom/include/esp32s3/rom/hmac.h
components/esp_rom/include/esp32s3/rom/opi_flash.h
components/esp_rom/include/esp32s3/rom/rom_layout.h
components/esp_rom/include/esp32s3/rom/rsa_pss.h
components/esp_rom/include/esp32s3/rom/sha.h
components/esp_rom/include/esp32s3/rom/tjpgd.h
Expand Down

0 comments on commit 3a45d4e

Please sign in to comment.