1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-01 18:31:54 +02:00
xburst-tools/flash-tool/usb.h
lindnermarek 8979988877 [flash-tool] complete inflash stage1
The stage1 file can be uploaded but the following bootstrap is not successful. Once this bug is found adding stage2 is no problem.
2009-04-26 10:37:31 +00:00

46 lines
1.4 KiB
C

/*
* "Ingenic flash tool" - flash the Ingenic CPU via USB
*
* (C) Copyright 2009
* Author: Marek Lindner <lindner_marek@yahoo.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 3 as published by the Free Software Foundation.
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA
*/
#define INGENIC_ENDPOINT 0x01
#define VR_GET_CPU_INFO 0x00
#define VR_SET_DATA_ADDRESS 0x01
#define VR_SET_DATA_LENGTH 0x02
#define VR_FLUSH_CACHES 0x03
#define VR_PROGRAM_START1 0x04
#define VR_PROGRAM_START2 0x05
#define STAGE1_ADDR_MSB 0x8000
#define STAGE1_ADDR_LSB 0x0000
#define STAGE2_ADDR_MSB 0x8000
#define STAGE2_ADDR_LSB 0x0000
#define USB_PACKET_SIZE 512
#define USB_TIMEOUT 5000
int usb_ingenic_init(struct ingenic_dev *ingenic_dev);
int usb_get_ingenic_cpu(struct ingenic_dev *ingenic_dev);
int usb_ingenic_upload(struct ingenic_dev *ingenic_dev, int stage);
void usb_ingenic_cleanup(struct ingenic_dev *ingenic_dev);