Lines Matching refs:reg_val

266 	u32 reg_val;  in arasan_nand_select_chip()  local
268 reg_val = readl(&arasan_nand_base->memadr_reg2); in arasan_nand_select_chip()
270 reg_val &= ~ARASAN_NAND_MEM_ADDR2_CS0_MASK; in arasan_nand_select_chip()
271 writel(reg_val, &arasan_nand_base->memadr_reg2); in arasan_nand_select_chip()
273 reg_val |= ARASAN_NAND_MEM_ADDR2_CS1_MASK; in arasan_nand_select_chip()
274 writel(reg_val, &arasan_nand_base->memadr_reg2); in arasan_nand_select_chip()
280 u32 reg_val; in arasan_nand_enable_ecc() local
282 reg_val = readl(&arasan_nand_base->cmd_reg); in arasan_nand_enable_ecc()
283 reg_val |= ARASAN_NAND_CMD_ECC_ON_MASK; in arasan_nand_enable_ecc()
285 writel(reg_val, &arasan_nand_base->cmd_reg); in arasan_nand_enable_ecc()
327 u32 reg_val, i, pktsize, pktnum; in arasan_nand_read_page() local
343 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_read_page()
344 reg_val |= ARASAN_NAND_INT_STS_ERR_EN_MASK | in arasan_nand_read_page()
346 writel(reg_val, &arasan_nand_base->intsts_enr); in arasan_nand_read_page()
348 reg_val = readl(&arasan_nand_base->pkt_reg); in arasan_nand_read_page()
349 reg_val &= ~(ARASAN_NAND_PKT_REG_PKT_CNT_MASK | in arasan_nand_read_page()
351 reg_val |= (pktnum << ARASAN_NAND_PKT_REG_PKT_CNT_SHFT) | in arasan_nand_read_page()
353 writel(reg_val, &arasan_nand_base->pkt_reg); in arasan_nand_read_page()
383 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_read_page()
384 reg_val |= ARASAN_NAND_INT_STS_XFR_CMPLT_MASK; in arasan_nand_read_page()
385 writel(reg_val, &arasan_nand_base->intsts_enr); in arasan_nand_read_page()
387 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_read_page()
388 writel(reg_val | ARASAN_NAND_INT_STS_BUF_RD_RDY_MASK, in arasan_nand_read_page()
391 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_read_page()
392 writel(reg_val | ARASAN_NAND_INT_STS_BUF_RD_RDY_MASK, in arasan_nand_read_page()
420 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_read_page()
421 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_read_page()
423 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_read_page()
424 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_read_page()
502 u32 reg_val, i, pktsize, pktnum; in arasan_nand_write_page_hwecc() local
520 reg_val = readl(&arasan_nand_base->pkt_reg); in arasan_nand_write_page_hwecc()
521 reg_val &= ~(ARASAN_NAND_PKT_REG_PKT_CNT_MASK | in arasan_nand_write_page_hwecc()
523 reg_val |= (pktnum << ARASAN_NAND_PKT_REG_PKT_CNT_SHFT) | pktsize; in arasan_nand_write_page_hwecc()
524 writel(reg_val, &arasan_nand_base->pkt_reg); in arasan_nand_write_page_hwecc()
552 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_write_page_hwecc()
553 reg_val |= ARASAN_NAND_INT_STS_XFR_CMPLT_MASK; in arasan_nand_write_page_hwecc()
554 writel(reg_val, &arasan_nand_base->intsts_enr); in arasan_nand_write_page_hwecc()
556 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_write_page_hwecc()
557 writel(reg_val | ARASAN_NAND_INT_STS_BUF_WR_RDY_MASK, in arasan_nand_write_page_hwecc()
561 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_write_page_hwecc()
562 writel(reg_val | ARASAN_NAND_INT_STS_BUF_WR_RDY_MASK, in arasan_nand_write_page_hwecc()
589 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_write_page_hwecc()
590 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_write_page_hwecc()
592 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_write_page_hwecc()
593 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_write_page_hwecc()
691 u32 reg_val, page; in arasan_nand_send_wrcmd() local
696 reg_val = readl(&arasan_nand_base->cmd_reg); in arasan_nand_send_wrcmd()
697 reg_val &= ~ARASAN_NAND_CMD_CMD12_MASK; in arasan_nand_send_wrcmd()
698 reg_val |= curr_cmd->cmd1 | in arasan_nand_send_wrcmd()
701 reg_val &= ~ARASAN_NAND_CMD_PG_SIZE_MASK; in arasan_nand_send_wrcmd()
703 reg_val |= (page_val << ARASAN_NAND_CMD_PG_SIZE_SHIFT); in arasan_nand_send_wrcmd()
706 reg_val &= ~ARASAN_NAND_CMD_ADDR_CYCL_MASK; in arasan_nand_send_wrcmd()
712 reg_val |= (addr_cycles << in arasan_nand_send_wrcmd()
714 writel(reg_val, &arasan_nand_base->cmd_reg); in arasan_nand_send_wrcmd()
724 reg_val = readl(&arasan_nand_base->memadr_reg2); in arasan_nand_send_wrcmd()
725 reg_val &= ~ARASAN_NAND_MEM_ADDR2_PAGE_MASK; in arasan_nand_send_wrcmd()
726 reg_val |= (page_addr >> ARASAN_NAND_MEM_ADDR1_PAGE_SHIFT); in arasan_nand_send_wrcmd()
727 writel(reg_val, &arasan_nand_base->memadr_reg2); in arasan_nand_send_wrcmd()
734 u32 reg_val; in arasan_nand_write_buf() local
737 reg_val = readl(&arasan_nand_base->pkt_reg); in arasan_nand_write_buf()
738 reg_val &= ~(ARASAN_NAND_PKT_REG_PKT_CNT_MASK | in arasan_nand_write_buf()
741 reg_val |= (1 << ARASAN_NAND_PKT_REG_PKT_CNT_SHFT) | len; in arasan_nand_write_buf()
742 writel(reg_val, &arasan_nand_base->pkt_reg); in arasan_nand_write_buf()
754 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_write_buf()
755 reg_val |= ARASAN_NAND_INT_STS_XFR_CMPLT_MASK; in arasan_nand_write_buf()
756 writel(reg_val, &arasan_nand_base->intsts_enr); in arasan_nand_write_buf()
757 writel(reg_val | ARASAN_NAND_INT_STS_BUF_WR_RDY_MASK, in arasan_nand_write_buf()
759 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_write_buf()
760 writel(reg_val | ARASAN_NAND_INT_STS_BUF_WR_RDY_MASK, in arasan_nand_write_buf()
785 u32 reg_val, page; in arasan_nand_erase() local
791 reg_val = readl(&arasan_nand_base->cmd_reg); in arasan_nand_erase()
792 reg_val &= ~ARASAN_NAND_CMD_CMD12_MASK; in arasan_nand_erase()
793 reg_val |= curr_cmd->cmd1 | in arasan_nand_erase()
800 reg_val &= ~ARASAN_NAND_CMD_ADDR_CYCL_MASK; in arasan_nand_erase()
801 reg_val |= (row_addr_cycles << in arasan_nand_erase()
804 writel(reg_val, &arasan_nand_base->cmd_reg); in arasan_nand_erase()
812 reg_val = readl(&arasan_nand_base->memadr_reg2); in arasan_nand_erase()
813 reg_val &= ~ARASAN_NAND_MEM_ADDR2_PAGE_MASK; in arasan_nand_erase()
814 reg_val |= (page_addr >> ARASAN_NAND_MEM_ADDR1_PAGE_SHIFT); in arasan_nand_erase()
815 writel(reg_val, &arasan_nand_base->memadr_reg2); in arasan_nand_erase()
828 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_erase()
829 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_erase()
831 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_erase()
832 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_erase()
841 u32 reg_val; in arasan_nand_read_status() local
847 reg_val = readl(&arasan_nand_base->cmd_reg); in arasan_nand_read_status()
848 reg_val &= ~ARASAN_NAND_CMD_CMD12_MASK; in arasan_nand_read_status()
849 reg_val |= curr_cmd->cmd1 | in arasan_nand_read_status()
856 reg_val &= ~ARASAN_NAND_CMD_ADDR_CYCL_MASK; in arasan_nand_read_status()
857 reg_val |= (addr_cycles << in arasan_nand_read_status()
860 writel(reg_val, &arasan_nand_base->cmd_reg); in arasan_nand_read_status()
862 reg_val = readl(&arasan_nand_base->pkt_reg); in arasan_nand_read_status()
863 reg_val &= ~(ARASAN_NAND_PKT_REG_PKT_CNT_MASK | in arasan_nand_read_status()
865 reg_val |= (1 << ARASAN_NAND_PKT_REG_PKT_CNT_SHFT) | 1; in arasan_nand_read_status()
866 writel(reg_val, &arasan_nand_base->pkt_reg); in arasan_nand_read_status()
880 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_read_status()
881 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_read_status()
883 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_read_status()
884 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_read_status()
893 u32 reg_val, addr_cycles, page; in arasan_nand_send_rdcmd() local
896 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_send_rdcmd()
897 writel(reg_val | ARASAN_NAND_INT_STS_BUF_RD_RDY_MASK, in arasan_nand_send_rdcmd()
900 reg_val = readl(&arasan_nand_base->cmd_reg); in arasan_nand_send_rdcmd()
901 reg_val &= ~ARASAN_NAND_CMD_CMD12_MASK; in arasan_nand_send_rdcmd()
902 reg_val |= curr_cmd->cmd1 | in arasan_nand_send_rdcmd()
907 reg_val &= ~ARASAN_NAND_CMD_PG_SIZE_MASK; in arasan_nand_send_rdcmd()
909 reg_val |= (page_val << ARASAN_NAND_CMD_PG_SIZE_SHIFT); in arasan_nand_send_rdcmd()
912 reg_val &= ~ARASAN_NAND_CMD_ECC_ON_MASK; in arasan_nand_send_rdcmd()
914 reg_val &= ~ARASAN_NAND_CMD_ADDR_CYCL_MASK; in arasan_nand_send_rdcmd()
921 reg_val |= (addr_cycles << 28); in arasan_nand_send_rdcmd()
922 writel(reg_val, &arasan_nand_base->cmd_reg); in arasan_nand_send_rdcmd()
932 reg_val = readl(&arasan_nand_base->memadr_reg2); in arasan_nand_send_rdcmd()
933 reg_val &= ~ARASAN_NAND_MEM_ADDR2_PAGE_MASK; in arasan_nand_send_rdcmd()
934 reg_val |= (page_addr >> ARASAN_NAND_MEM_ADDR1_PAGE_SHIFT); in arasan_nand_send_rdcmd()
935 writel(reg_val, &arasan_nand_base->memadr_reg2); in arasan_nand_send_rdcmd()
944 u32 reg_val, i; in arasan_nand_read_buf() local
948 reg_val = readl(&arasan_nand_base->pkt_reg); in arasan_nand_read_buf()
949 reg_val &= ~(ARASAN_NAND_PKT_REG_PKT_CNT_MASK | in arasan_nand_read_buf()
951 reg_val |= (1 << ARASAN_NAND_PKT_REG_PKT_CNT_SHFT) | size; in arasan_nand_read_buf()
952 writel(reg_val, &arasan_nand_base->pkt_reg); in arasan_nand_read_buf()
965 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_read_buf()
966 reg_val |= ARASAN_NAND_INT_STS_XFR_CMPLT_MASK; in arasan_nand_read_buf()
967 writel(reg_val, &arasan_nand_base->intsts_enr); in arasan_nand_read_buf()
969 writel(reg_val | ARASAN_NAND_INT_STS_BUF_RD_RDY_MASK, in arasan_nand_read_buf()
971 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_read_buf()
972 writel(reg_val | ARASAN_NAND_INT_STS_BUF_RD_RDY_MASK, in arasan_nand_read_buf()
993 reg_val = readl(&arasan_nand_base->intsts_enr); in arasan_nand_read_buf()
994 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_read_buf()
996 reg_val = readl(&arasan_nand_base->intsts_reg); in arasan_nand_read_buf()
997 writel(reg_val | ARASAN_NAND_INT_STS_XFR_CMPLT_MASK, in arasan_nand_read_buf()