gustavonihei commented on a change in pull request #5827: URL: https://github.com/apache/incubator-nuttx/pull/5827#discussion_r833249342
########## File path: arch/xtensa/src/esp32s2/esp32s2_psram.h ########## @@ -0,0 +1,150 @@ +/**************************************************************************** + * arch/xtensa/src/esp32s2/esp32s2_psram.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#ifndef __ARCH_XTENSA_SRC_ESP32S2_ESP32S2_PSRAM_H +#define __ARCH_XTENSA_SRC_ESP32S2_ESP32S2_PSRAM_H + +#define PSRAM_SIZE_2MB (2 * 1024 * 1024) +#define PSRAM_SIZE_4MB (4 * 1024 * 1024) +#define PSRAM_SIZE_8MB (8 * 1024 * 1024) +#define PSRAM_SIZE_16MB (16 * 1024 * 1024) +#define PSRAM_SIZE_32MB (32 * 1024 * 1024) + +#define PSRAM_SIZE_16MBITS 0 +#define PSRAM_SIZE_32MBITS 1 +#define PSRAM_SIZE_64MBITS 2 +#define PSRAM_SIZE_MAX 3 + +#define PSRAM_CACHE_S80M 1 +#define PSRAM_CACHE_S40M 2 +#define PSRAM_CACHE_S26M 3 +#define PSRAM_CACHE_S20M 4 +#define PSRAM_CACHE_MAX 5 + +#define SPIRAM_WRAP_MODE_16B 0 +#define SPIRAM_WRAP_MODE_32B 1 +#define SPIRAM_WRAP_MODE_64B 2 +#define SPIRAM_WRAP_MODE_DISABLE 3 + +/* See the TRM, chapter PID/MPU/MMU, header 'External RAM' for the + * definitions of these modes. Important is that NORMAL works with the app + * CPU cache disabled, but gives huge cache coherency issues when both app + * and pro CPU are enabled. LOWHIGH and EVENODD do not have these coherency + * issues but cannot be used when the app CPU cache is disabled. + */ + +#define PSRAM_VADDR_MODE_NORMAL 0 /* App and Pro CPU use their own flash + * cache for external RAM access + */ + +#define PSRAM_VADDR_MODE_LOWHIGH 1 /* App and Pro CPU share external RAM caches: + * pro CPU has low 2M, app CPU has high 2M + */ + +#define PSRAM_VADDR_MODE_EVENODD 2 /* App and Pro CPU share external RAM caches: + * pro CPU does even 32yte ranges, app does + * odd ones. + */ Review comment: ```suggestion ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org