blob: 16b44ccea0696425204924698c56d27f2eda41fb [file] [log] [blame]
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +02001/*
2 * (C) Copyright 2007
3 * Markus Klotzbuecher, DENX Software Engineering <mk@denx.de>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +02006 */
7
8#include <common.h>
9
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020010#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +020011
Matthias Fuchs9be659a2007-11-09 15:37:23 +010012#ifdef CONFIG_4xx_DCACHE
13#include <asm/mmu.h>
14DECLARE_GLOBAL_DATA_PTR;
15#endif
16
Stefan Roese3b3bff42007-08-14 16:36:29 +020017int usb_cpu_init(void)
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +020018{
Matthias Fuchs9be659a2007-11-09 15:37:23 +010019#ifdef CONFIG_4xx_DCACHE
20 /* disable cache */
21 change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, TLB_WORD2_I_ENABLE);
22#endif
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +020023
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +020024 return 0;
25}
26
Stefan Roese3b3bff42007-08-14 16:36:29 +020027int usb_cpu_stop(void)
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +020028{
Matthias Fuchs9be659a2007-11-09 15:37:23 +010029#ifdef CONFIG_4xx_DCACHE
30 /* enable cache */
31 change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
32#endif
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +020033 return 0;
34}
35
Stefan Roese3b3bff42007-08-14 16:36:29 +020036int usb_cpu_init_fail(void)
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +020037{
Matthias Fuchs9be659a2007-11-09 15:37:23 +010038#ifdef CONFIG_4xx_DCACHE
39 /* enable cache */
40 change_tlb(gd->bd->bi_memstart, gd->bd->bi_memsize, 0);
41#endif
Markus Klotzbuecherdace45a2007-06-06 11:49:43 +020042 return 0;
43}
44
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020045#endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */