#include "pxmcc_types.h"
#include "pxmcc_interface.h"
+#ifdef CONFIG_OC_MTD_DRV_SYSLESS
+#include <mtd_spi_drv.h>
+#endif
+
int cmd_do_test_memusage(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
{
void *maxaddr;
int cmd_do_mtdspitest(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
{
- mtd_spi_test();
+ int res;
+ unsigned char id_buff[3];
+
+ res = mtd_spi_read_jedec_id(&mtd_spi_state, id_buff, 3);
+ if (res < 0) {
+ printf("mtd_spi_read_jedec_id returned %d\n", res);
+ return -1;
+ }
+
+ printf("mtd_spi_read_jedec_id 0x%02x 0x%02x 0x%02x \n",
+ id_buff[0], id_buff[1], id_buff[2]);
+
+ res = mtd_spi_set_protect_mode(&mtd_spi_state, 0, 0);
+ if (res < 0) {
+ printf("mtd_spi_set_protect_mode returned %d\n", res);
+ return -1;
+ }
+
return 0;
}