From 5d8f35d88e448840bb431ab98ddd73223b6cf04c Mon Sep 17 00:00:00 2001 From: Peter Zotov Date: Sat, 4 Dec 2010 06:43:15 +0300 Subject: [PATCH] Add USBBoot cmdset skeleton. --- Makefile | 2 +- shell.c | 3 ++- shell.h | 1 + usbboot_cmdset.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 usbboot_cmdset.c diff --git a/Makefile b/Makefile index b664f86..87f5e00 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ endif CC = gcc TARGET = jzboot -SOURCES = debug.c devmgr.c ingenic.c main.c shell_lex.c usbdev.c shell.c config.c spl_cmdset.c +SOURCES = debug.c devmgr.c ingenic.c main.c shell_lex.c usbdev.c shell.c config.c spl_cmdset.c usbboot_cmdset.c CFLAGS = --std=gnu99 -Wall -Werror -O2 $(shell pkg-config libusb-1.0 --cflags) LIBS += $(shell pkg-config libusb-1.0 --libs) diff --git a/shell.c b/shell.c index 524de3a..d86e1c1 100644 --- a/shell.c +++ b/shell.c @@ -399,7 +399,8 @@ static const struct { const char *name; const shell_command_t *commands; } cmdsets[] = { - { CMDSET_SPL, "SPL", spl_cmdset }, + { CMDSET_SPL, "SPL", spl_cmdset }, + { CMDSET_USBBOOT, "USBBoot", usbboot_cmdset }, { 0, NULL, NULL } }; diff --git a/shell.h b/shell.h index 6a7b429..0f11518 100644 --- a/shell.h +++ b/shell.h @@ -45,5 +45,6 @@ extern char *strval; int shell_pull(char *buf, int maxlen); extern const shell_command_t spl_cmdset[]; +extern const shell_command_t usbboot_cmdset[]; #endif diff --git a/usbboot_cmdset.c b/usbboot_cmdset.c new file mode 100644 index 0000000..221c73c --- /dev/null +++ b/usbboot_cmdset.c @@ -0,0 +1,28 @@ +/* + * JzBoot: an USB bootloader for JZ series of Ingenic(R) microprocessors. + * Copyright (C) 2010 Peter Zotov + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "shell.h" +#include "config.h" +#include "ingenic.h" + +const shell_command_t usbboot_cmdset[] = { + { NULL, NULL, NULL } +};