Lines Matching refs:cxld

663 static int mock_decoder_commit(struct cxl_decoder *cxld)  in mock_decoder_commit()  argument
665 struct cxl_port *port = to_cxl_port(cxld->dev.parent); in mock_decoder_commit()
666 int id = cxld->id; in mock_decoder_commit()
668 if (cxld->flags & CXL_DECODER_F_ENABLE) in mock_decoder_commit()
671 dev_dbg(&port->dev, "%s commit\n", dev_name(&cxld->dev)); in mock_decoder_commit()
675 dev_name(&cxld->dev), port->id, port->commit_end + 1); in mock_decoder_commit()
680 cxld->flags |= CXL_DECODER_F_ENABLE; in mock_decoder_commit()
685 static int mock_decoder_reset(struct cxl_decoder *cxld) in mock_decoder_reset() argument
687 struct cxl_port *port = to_cxl_port(cxld->dev.parent); in mock_decoder_reset()
688 int id = cxld->id; in mock_decoder_reset()
690 if ((cxld->flags & CXL_DECODER_F_ENABLE) == 0) in mock_decoder_reset()
693 dev_dbg(&port->dev, "%s reset\n", dev_name(&cxld->dev)); in mock_decoder_reset()
697 dev_name(&cxld->dev), port->id, port->commit_end); in mock_decoder_reset()
702 cxld->flags &= ~CXL_DECODER_F_ENABLE; in mock_decoder_reset()
707 static void default_mock_decoder(struct cxl_decoder *cxld) in default_mock_decoder() argument
709 cxld->hpa_range = (struct range){ in default_mock_decoder()
714 cxld->interleave_ways = 1; in default_mock_decoder()
715 cxld->interleave_granularity = 256; in default_mock_decoder()
716 cxld->target_type = CXL_DECODER_EXPANDER; in default_mock_decoder()
717 cxld->commit = mock_decoder_commit; in default_mock_decoder()
718 cxld->reset = mock_decoder_reset; in default_mock_decoder()
723 struct cxl_decoder *cxld; in first_decoder() local
727 cxld = to_cxl_decoder(dev); in first_decoder()
728 if (cxld->id == 0) in first_decoder()
733 static void mock_init_hdm_decoder(struct cxl_decoder *cxld) in mock_init_hdm_decoder() argument
748 if (is_endpoint_decoder(&cxld->dev)) { in mock_init_hdm_decoder()
749 cxled = to_cxl_endpoint_decoder(&cxld->dev); in mock_init_hdm_decoder()
777 if (!hb0 || pdev->id % 4 || pdev->id > 4 || cxld->id > 0) { in mock_init_hdm_decoder()
778 default_mock_decoder(cxld); in mock_init_hdm_decoder()
783 cxld->hpa_range = (struct range) { in mock_init_hdm_decoder()
788 cxld->interleave_ways = 2; in mock_init_hdm_decoder()
789 eig_to_granularity(window->granularity, &cxld->interleave_granularity); in mock_init_hdm_decoder()
790 cxld->target_type = CXL_DECODER_EXPANDER; in mock_init_hdm_decoder()
791 cxld->flags = CXL_DECODER_F_ENABLE; in mock_init_hdm_decoder()
793 port->commit_end = cxld->id; in mock_init_hdm_decoder()
794 devm_cxl_dpa_reserve(cxled, 0, size / cxld->interleave_ways, 0); in mock_init_hdm_decoder()
795 cxld->commit = mock_decoder_commit; in mock_init_hdm_decoder()
796 cxld->reset = mock_decoder_reset; in mock_init_hdm_decoder()
822 cxld = &cxlsd->cxld; in mock_init_hdm_decoder()
823 cxld->target_type = CXL_DECODER_EXPANDER; in mock_init_hdm_decoder()
824 cxld->flags = CXL_DECODER_F_ENABLE; in mock_init_hdm_decoder()
831 cxld->interleave_ways = 2; in mock_init_hdm_decoder()
833 cxld->interleave_ways = 1; in mock_init_hdm_decoder()
834 cxld->interleave_granularity = 256; in mock_init_hdm_decoder()
835 cxld->hpa_range = (struct range) { in mock_init_hdm_decoder()
863 struct cxl_decoder *cxld; in mock_cxl_enumerate_decoders() local
875 cxld = &cxlsd->cxld; in mock_cxl_enumerate_decoders()
886 cxld = &cxled->cxld; in mock_cxl_enumerate_decoders()
889 mock_init_hdm_decoder(cxld); in mock_cxl_enumerate_decoders()
895 put_device(&cxld->dev); in mock_cxl_enumerate_decoders()
900 rc = cxl_decoder_add_locked(cxld, target_map); in mock_cxl_enumerate_decoders()
902 put_device(&cxld->dev); in mock_cxl_enumerate_decoders()
907 rc = cxl_decoder_autoremove(&port->dev, cxld); in mock_cxl_enumerate_decoders()
910 dev_dbg(&cxld->dev, "Added to port %s\n", dev_name(&port->dev)); in mock_cxl_enumerate_decoders()