1*ce099b40Smartin /* -*-C++-*- $NetBSD: mips_vr41.h,v 1.4 2008/04/28 20:23:20 martin Exp $ */ 29173eae7Such 39173eae7Such /*- 49173eae7Such * Copyright (c) 2001 The NetBSD Foundation, Inc. 59173eae7Such * All rights reserved. 69173eae7Such * 79173eae7Such * This code is derived from software contributed to The NetBSD Foundation 89173eae7Such * by UCHIYAMA Yasushi. 99173eae7Such * 109173eae7Such * Redistribution and use in source and binary forms, with or without 119173eae7Such * modification, are permitted provided that the following conditions 129173eae7Such * are met: 139173eae7Such * 1. Redistributions of source code must retain the above copyright 149173eae7Such * notice, this list of conditions and the following disclaimer. 159173eae7Such * 2. Redistributions in binary form must reproduce the above copyright 169173eae7Such * notice, this list of conditions and the following disclaimer in the 179173eae7Such * documentation and/or other materials provided with the distribution. 189173eae7Such * 199173eae7Such * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 209173eae7Such * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 219173eae7Such * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 229173eae7Such * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 239173eae7Such * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 249173eae7Such * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 259173eae7Such * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 269173eae7Such * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 279173eae7Such * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 289173eae7Such * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 299173eae7Such * POSSIBILITY OF SUCH DAMAGE. 309173eae7Such */ 319173eae7Such 329173eae7Such #include <hpcboot.h> 339173eae7Such #include <mips/mips_arch.h> 349173eae7Such 359173eae7Such class VR41XX : public MIPSArchitecture { 369173eae7Such private: 379173eae7Such 389173eae7Such public: 399173eae7Such VR41XX(Console *&, MemoryManager *&); 409173eae7Such ~VR41XX(void); 419173eae7Such 429173eae7Such virtual BOOL init(void); 439173eae7Such virtual void systemInfo(void); 449173eae7Such virtual void cacheFlush(void); 459173eae7Such static void boot_func(struct BootArgs *, struct PageTag *); 469173eae7Such }; 479173eae7Such 489173eae7Such #define MIPS_VR41XX_CACHE_FLUSH() \ 499173eae7Such __asm( \ 509173eae7Such ".set noreorder;" \ 519173eae7Such /* Flush I-cache */ \ 529173eae7Such "li t0, 0x80000000;" \ 539173eae7Such "addu t1, t0, 1024*128;" \ 549173eae7Such "subu t1, t1, 128;" \ 559173eae7Such "1:" \ 569173eae7Such "cache 0, 0(t0);" \ 579173eae7Such "cache 0, 16(t0);" \ 589173eae7Such "cache 0, 32(t0);" \ 599173eae7Such "cache 0, 48(t0);" \ 609173eae7Such "cache 0, 64(t0);" \ 619173eae7Such "cache 0, 80(t0);" \ 629173eae7Such "cache 0, 96(t0);" \ 639173eae7Such "cache 0, 112(t0);" \ 649173eae7Such "bne t0, t1, 1b;" \ 659173eae7Such "addu t0, t0, 128;" \ 669173eae7Such \ 679173eae7Such /* Flush D-cache */ \ 689173eae7Such "li t0, 0x80000000;" \ 699173eae7Such "addu t1, t0, 1024*128;" \ 709173eae7Such "subu t1, t1, 128;" \ 719173eae7Such "2:" \ 729173eae7Such "cache 1, 0(t0);" \ 739173eae7Such "cache 1, 16(t0);" \ 749173eae7Such "cache 1, 32(t0);" \ 759173eae7Such "cache 1, 48(t0);" \ 769173eae7Such "cache 1, 64(t0);" \ 779173eae7Such "cache 1, 80(t0);" \ 789173eae7Such "cache 1, 96(t0);" \ 799173eae7Such "cache 1, 112(t0);" \ 809173eae7Such "bne t0, t1, 2b;" \ 819173eae7Such "addu t0, t0, 128;" \ 829173eae7Such ".set reorder;" \ 839173eae7Such ) 84