From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 30 Jun 2016 08:23:58 -0700 Subject: [U-Boot] [PATCH 3/4] rockchip: rk3288: add fastboot support In-Reply-To: <1467271321-17605-4-git-send-email-xzy.xu@rock-chips.com> References: <1467271321-17605-1-git-send-email-xzy.xu@rock-chips.com> <1467271321-17605-4-git-send-email-xzy.xu@rock-chips.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Ziyuan, On 30 June 2016 at 00:22, Ziyuan Xu wrote: > Enable fastboot feature on rk3288. > > This path doesn't support the fastboot flash function command entirely. > We will hit "cannot find partition" assertion without specified > partition environment. Define gpt partition layout in specified board > such as firefly-rk3288, then enjoy it! > > Signed-off-by: Ziyuan Xu > --- > > arch/arm/mach-rockchip/board.c | 20 ++++++++++++++++++++ > include/configs/rk3288_common.h | 25 +++++++++++++++++++++++++ > 2 files changed, 45 insertions(+) > > diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c > index 816540e..9766ba0 100644 > --- a/arch/arm/mach-rockchip/board.c > +++ b/arch/arm/mach-rockchip/board.c > @@ -52,6 +52,26 @@ void lowlevel_init(void) > { > } > > +#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG) > +#include > +#include > + > +static struct dwc2_plat_otg_data rk3288_otg_data = { > + .regs_phy = 0xff770000, > + .regs_otg = 0xff580000, Shouldn't these come from the device tree? > +}; > + > +int board_usb_init(int index, enum usb_init_type init) > +{ > + return dwc2_udc_probe(&rk3288_otg_data); > +} > + > +int board_usb_cleanup(int index, enum usb_init_type init) > +{ > + return 0; > +} > +#endif > + > static int do_clock(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > { > diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h > index 9d50d83..f8a6c98 100644 > --- a/include/configs/rk3288_common.h > +++ b/include/configs/rk3288_common.h > @@ -80,6 +80,31 @@ > #define CONFIG_SPI > #define CONFIG_SF_DEFAULT_SPEED 20000000 > > +/* usb otg */ > +#define CONFIG_USB_GADGET > +#define CONFIG_USB_GADGET_DUALSPEED > +#define CONFIG_USB_GADGET_DWC2_OTG > +#define CONFIG_RK3288_USB_PHY > +#define CONFIG_USB_GADGET_VBUS_DRAW 0 > + > +/* fastboot */ > +#define CONFIG_CMD_FASTBOOT > +#define CONFIG_USB_FUNCTION_FASTBOOT > +#define CONFIG_FASTBOOT_FLASH > +#define CONFIG_FASTBOOT_FLASH_MMC_DEV 1 /* eMMC */ > +#define CONFIG_FASTBOOT_BUF_ADDR (CONFIG_SYS_SDRAM_BASE \ > + + SDRAM_BANK_SIZE) Can you add a comment as to why the buffer is placed here? > +#define CONFIG_FASTBOOT_BUF_SIZE 0x08000000 > + > +#define CONFIG_USB_GADGET_DOWNLOAD > +#define CONFIG_G_DNL_MANUFACTURER "Rockchip" > +#define CONFIG_G_DNL_VENDOR_NUM 0x2207 > +#define CONFIG_G_DNL_PRODUCT_NUM 0x320a > + > +/* Enable gpt partition table */ > +#define CONFIG_CMD_GPT > +#define CONFIG_EFI_PARTITION > + > #ifndef CONFIG_SPL_BUILD > #include > > -- > 1.9.1 > > Regards, Simon