| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: PCIeIORd.s |
| 5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved |
| 6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
| 7 | * |
| 8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; version 2 of the License. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * |
| 23 | * For the avoidance of doubt, and except that if any non-GPL license |
| 24 | * choice is available it will apply instead, Sun elects to use only |
| 25 | * the General Public License version 2 (GPLv2) at this time for any |
| 26 | * software where a choice of GPL license versions is made |
| 27 | * available with the language indicating that GPLv2 or any later version |
| 28 | * may be used, or where a choice of which version of the GPL is applied is |
| 29 | * otherwise unspecified. |
| 30 | * |
| 31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 32 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 33 | * have any questions. |
| 34 | * |
| 35 | * |
| 36 | * ========== Copyright Header End ============================================ |
| 37 | */ |
| 38 | #define ENABLE_PCIE_LINK_TRAINING |
| 39 | #define MAIN_PAGE_HV_ALSO |
| 40 | |
| 41 | #include "hboot.s" |
| 42 | #include "peu_defines.h" |
| 43 | |
| 44 | |
| 45 | #define IO_RD_ADDR mpeval((N2_PCIE_BASE_ADDR + (IOCFG_OFFSET_BASE_REG_DATA & 0x7fffffffffffffff)) | IO_ACCESS_PA) |
| 46 | |
| 47 | |
| 48 | /************************************************************************ |
| 49 | Test case code start |
| 50 | ************************************************************************/ |
| 51 | .text |
| 52 | .global main |
| 53 | |
| 54 | main: |
| 55 | ta T_CHANGE_HPRIV |
| 56 | nop |
| 57 | |
| 58 | ! select an IO address in PCI address range and transmit the command to NCU |
| 59 | setx IO_RD_ADDR, %g1, %g2 |
| 60 | |
| 61 | ! load byte - all byte offsets within an octlet |
| 62 | ldub [%g2 + 1*8 + 0], %l0 |
| 63 | ldub [%g2 + 2*8 + 1], %l1 |
| 64 | ldub [%g2 + 3*8 + 2], %l2 |
| 65 | ldub [%g2 + 4*8 + 3], %l3 |
| 66 | ldub [%g2 + 5*8 + 4], %l4 |
| 67 | ldub [%g2 + 6*8 + 5], %l5 |
| 68 | ldub [%g2 + 7*8 + 6], %l6 |
| 69 | ldub [%g2 + 8*8 + 7], %l7 |
| 70 | |
| 71 | ! load half-word - all half-word offsets within an octlet |
| 72 | lduh [%g2 + 9*8 + 0], %o0 |
| 73 | lduh [%g2 + 10*8 + 2], %o1 |
| 74 | lduh [%g2 + 11*8 + 4], %o2 |
| 75 | lduh [%g2 + 12*8 + 6], %o3 |
| 76 | |
| 77 | ! Load word - all word offsets within an octlet |
| 78 | lduw [%g2 + 13*8 + 0], %o4 |
| 79 | lduw [%g2 + 14*8 + 4], %o5 |
| 80 | |
| 81 | test_passed: |
| 82 | EXIT_GOOD |
| 83 | |
| 84 | test_failed: |
| 85 | EXIT_BAD |
| 86 | |
| 87 | /************************************************************************ |
| 88 | Test case data start |
| 89 | ************************************************************************/ |
| 90 | |
| 91 | SECTION .DATA DATA_VA=IO_RD_ADDR |
| 92 | attr_data { |
| 93 | Name = .DATA, |
| 94 | hypervisor, |
| 95 | compressimage |
| 96 | } |
| 97 | |
| 98 | .data |
| 99 | .xword 0xdeadbeefdeadbeef |
| 100 | |
| 101 | .xword 0x1101010101010101 |
| 102 | .xword 0x0122010101010101 |
| 103 | .xword 0x0101330101010101 |
| 104 | .xword 0x0101014401010101 |
| 105 | .xword 0x0101010155010101 |
| 106 | .xword 0x0101010101660101 |
| 107 | .xword 0x0101010101017701 |
| 108 | .xword 0x0101010101010188 |
| 109 | |
| 110 | .xword 0x1122010101010101 |
| 111 | .xword 0x0101334401010101 |
| 112 | .xword 0x0101010155660101 |
| 113 | .xword 0x0101010101017788 |
| 114 | |
| 115 | .xword 0x1122334401010101 |
| 116 | .xword 0x0101010155667788 |
| 117 | |
| 118 | .xword 0xdeadbeefdeadbeef |
| 119 | |
| 120 | /************************************************************************/ |