Path: blob/master/arch/arm/boot/compressed/misc-ep93xx.h
29269 views
/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* Copyright (C) 2006 Lennert Buytenhek <[email protected]>3*/45#include <asm/mach-types.h>67static inline unsigned int __raw_readl(unsigned int ptr)8{9return *((volatile unsigned int *)ptr);10}1112static inline void __raw_writeb(unsigned char value, unsigned int ptr)13{14*((volatile unsigned char *)ptr) = value;15}1617static inline void __raw_writel(unsigned int value, unsigned int ptr)18{19*((volatile unsigned int *)ptr) = value;20}2122/*23* Some bootloaders don't turn off DMA from the ethernet MAC before24* jumping to linux, which means that we might end up with bits of RX25* status and packet data scribbled over the uncompressed kernel image.26* Work around this by resetting the ethernet MAC before we uncompress.27*/28#define PHYS_ETH_SELF_CTL 0x8001002029#define ETH_SELF_CTL_RESET 0x000000013031static inline void ep93xx_ethernet_reset(void)32{33unsigned int v;3435/* Reset the ethernet MAC. */36v = __raw_readl(PHYS_ETH_SELF_CTL);37__raw_writel(v | ETH_SELF_CTL_RESET, PHYS_ETH_SELF_CTL);3839/* Wait for reset to finish. */40while (__raw_readl(PHYS_ETH_SELF_CTL) & ETH_SELF_CTL_RESET)41;42}4344#define TS72XX_WDT_CONTROL_PHYS_BASE 0x2380000045#define TS72XX_WDT_FEED_PHYS_BASE 0x23c0000046#define TS72XX_WDT_FEED_VAL 0x054748static inline void __maybe_unused ts72xx_watchdog_disable(void)49{50__raw_writeb(TS72XX_WDT_FEED_VAL, TS72XX_WDT_FEED_PHYS_BASE);51__raw_writeb(0, TS72XX_WDT_CONTROL_PHYS_BASE);52}5354static inline void ep93xx_decomp_setup(void)55{56if (machine_is_ts72xx())57ts72xx_watchdog_disable();5859if (machine_is_edb9301() ||60machine_is_edb9302() ||61machine_is_edb9302a() ||62machine_is_edb9302a() ||63machine_is_edb9307() ||64machine_is_edb9307a() ||65machine_is_edb9307a() ||66machine_is_edb9312() ||67machine_is_edb9315() ||68machine_is_edb9315a() ||69machine_is_edb9315a() ||70machine_is_ts72xx() ||71machine_is_bk3() ||72machine_is_vision_ep9307())73ep93xx_ethernet_reset();74}757677