OpenBIC
OpenSource Bridge-IC
flash_shell.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef FLASH_SHELL_H
18#define FLASH_SHELL_H
19
20#include <stdlib.h>
21#include <shell/shell.h>
22#include <drivers/spi_nor.h>
23#include <drivers/flash.h>
24
25#define SPI_DEVICE_PREFIX "spi"
26#define MAX_SFDP_BUFF_SIZE 256
27
28void cmd_flash_re_init(const struct shell *shell, size_t argc, char **argv);
29void cmd_flash_sfdp_read(const struct shell *shell, size_t argc, char **argv);
30void device_spi_name_get(size_t idx, struct shell_static_entry *entry);
31
33
35 SHELL_CMD(re_init, &spi_device_name, "Re-init spi config",
37 SHELL_CMD(sfpd_read, &spi_device_name, "SFPD read",
39 SHELL_SUBCMD_SET_END);
40
41#endif
uint8_t idx
Definition: plat_util.c:39
SHELL_DYNAMIC_CMD_CREATE(spi_device_name, device_spi_name_get)
void device_spi_name_get(size_t idx, struct shell_static_entry *entry)
Definition: flash_shell.c:115
SHELL_STATIC_SUBCMD_SET_CREATE(sub_flash_cmds, SHELL_CMD(re_init, &spi_device_name, "Re-init spi config", cmd_flash_re_init), SHELL_CMD(sfpd_read, &spi_device_name, "SFPD read", cmd_flash_sfdp_read), SHELL_SUBCMD_SET_END)
void cmd_flash_sfdp_read(const struct shell *shell, size_t argc, char **argv)
Definition: flash_shell.c:52
void cmd_flash_re_init(const struct shell *shell, size_t argc, char **argv)
Definition: flash_shell.c:29